An AI agent to chat with you with data, using OpenAI and
Workflow Description
An intelligent conversational agent powered by OpenAI and PostgreSQL, receiving requests via Webhook, retrieving contextual data, and responding intelligently to user inquiries with multi-step workflow logic and tool integration.
How it works
- 1.Receive incoming request through Webhook and parse message content
- 2.Query PostgreSQL database to retrieve relevant context and stored data
- 3.Process request through OpenAI agent with conditional logic and specialized tools
- 4.Execute advanced workflow branches based on request type and required outputs
- 5.Send response through appropriate channel and log interaction in database
Use cases
- Deploy an AI assistant that understands business-specific data and answers customer questions intelligently
- Build an interactive data analysis platform that connects databases with AI reasoning capabilities
Requirements
- OpenAI API account with valid authentication key and sufficient credits
- PostgreSQL database configured with relevant schemas, tables, and data
- Webhook endpoint configured to receive requests from external platforms
- Running n8n instance with compatible version and proper environment variables
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (30)
Postgres Chat Memory
Memory Postgres Chat
OpenAI Chat Model
OpenAI
Set fields
Set
Sticky Note
Sticky Note
Webhook - ChatInput
Webhook
Sticky Note1
Sticky Note
Respond to Webhook
Webhook
Sticky Note2
Sticky Note
Call Search Console Tool
Tool Workflow
Sticky Note3
Sticky Note
Sticky Note4
Sticky Note
Sticky Note6
Sticky Note
Sticky Note5
Sticky Note
Sticky Note7
Sticky Note
Tool calling
Execute Workflow Trigger
Switch
Switch
Set fields - Consruct API CALL
Set
Sticky Note8
Sticky Note
Set fields - Create searchConsoleDataArray
Set
Set fields - Create searchConsoleDataArray 2
Set
Search Console - Get Custom Insights
HTTP Request
Sticky Note9
Sticky Note
Sticky Note10
Sticky Note
## Search Console - Get List of Properties
HTTP Request
Sticky Note11
Sticky Note
Sticky Note12
Sticky Note
Array aggregation - response to AI Agent
Aggregate
Array aggregation - response to AI Agent1
Aggregate
Sticky Note13
Sticky Note
AI Agent
Agent