✨📊Multi-AI agent chatbot for Postgres/Supabase DB and QuickCharts + tool router
Needs changesWhat this workflow does
This AI workflow has 19 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Postgres, OpenAI Chat Model and Postgres Chat Memory.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- 🤖Primary Agent (AI Agent): runs an AI agent, with model: gpt-4o-mini; 2 tools (query_db_tool, generate_quickchart_tool); memory: Postgres Chat Memory
- 🔀Tool Agent Router (Switch): routes items into 2 branches
- 🤖Secondary Postgres Agent (AI Agent): runs an AI agent, with model: gpt-40-mini-; 3 tools (Execute SQL Query, Table Definitions, DB Schema and Tables)
- 🤖Secondary QuickChart Agent (AI Agent): runs an AI agent, with model: gpt-4o-mini-; output parser: QuickChart Object Schema
- QuickChart GET URL (Edit Fields (Set)): sets 1 field: url
- Create QuickChart (HTTP Request): calls an HTTP API
- Final QuickChart URL (Edit Fields (Set)): sets 1 field: quickchart_url
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in 🤖Primary Agent (v1.7), 🤖Secondary Postgres Agent (v1.7), 🤖Secondary QuickChart Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) 🤖Primary Agent (v1.7), 🤖Secondary Postgres Agent (v1.7), 🤖Secondary QuickChart Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (11)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Postgres Tool
n8n-nodes-base.postgresTool - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - HTTP Request
n8n-nodes-base.httpRequest - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Switch
n8n-nodes-base.switch - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Edit Fields (Set)
n8n-nodes-base.set
From the author
Multi-AI Agent Chatbot for Postgres/Supabase Databases and QuickChart Generation Who is this for? This workflow is ideal for data analysts, developers, and business intelligence teams who need an AI-powered chatbot to query Postgres/Supabase databases and…