PostgreSQL conversational agent with Claude & DeepSeek (Multi-KPI, Secure)
Needs changesWhat this workflow does
This AI workflow has 18 nodes and runs when an MCP client calls one of its tools (plus 2 other triggers). Along the way it connects Postgres, MCP Client and Anthropic Chat Model.
How it runs
Trigger: When an MCP client calls one of its tools (plus 2 other triggers).
- Operation (Switch): routes items into branches
- AI Agent: runs an AI agent, with model: Anthropic Chat Model; 2 tools (Think, MCP Client); memory: Simple Memory
- ReadTableRecord (Postgres): uses Postgres
- CreateTableRecord (Postgres): uses Postgres
- UpdateTableRecord (Postgres): uses Postgres
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 AI Agent (v1.8): 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) AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (12)
- Postgres Tool
n8n-nodes-base.postgresTool - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Postgres
n8n-nodes-base.postgres - Switch
n8n-nodes-base.switch - MCP Server Trigger
@n8n/n8n-nodes-langchain.mcpTrigger - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - MCP Client Tool
@n8n/n8n-nodes-langchain.mcpClientTool - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Think Tool
@n8n/n8n-nodes-langchain.toolThink
From the author
🧠 Conversational PostgreSQL Agent Enable AI-driven conversations with your PostgreSQL database using a secure and visual-free agent powered by n8n’s Model Context Protocol (MCP). This template allows users to ask multiple KPIs in a single message, returning…