Chat with Postgresql Database
n8n template #2859Summary
Use templateWho is this template for? This workflow template is designed for any professionals seeking relevent data from database using natural language. How it works Each time user ask's question using the n8n chat interface, the workflow runs. Then the message is processed by AI Agent using relevent tools - Execute SQL Query, Get DB Schema and Tables List and Get Table Definition, if required. Agent uses these tool to form and run sql query which are necessary to answer the questions. Once AI Agent has the data, it uses it to form answer and returns it to the user. Set up instructions Complete the Set up credentials step when you first open the workflow. You'll need a Postgresql Credentials, and Open
How to set it up
- Open template #2859 on n8n.io and click Use for free, or copy the template JSON and paste it onto an empty canvas in n8n.
- Create a credential under Credentials → Add credential: OpenAI Chat Model. Then open each of those nodes and pick the credential.
- Check the model in the AI Agent node. The template may point at a model your account can't use; swap it for one you have access to.
- Click Execute workflow and step through each node's output to confirm the data looks right.
- Toggle the workflow to Active so its trigger runs on its own.
Hand off to your agent
Prompt
Help me set up the n8n workflow "Chat with Postgresql Database" (https://n8n.io/workflows/2859). It uses: AI Agent, OpenAI Chat Model, Simple Memory. Import the template JSON into my n8n instance, list every credential I need to create, and walk me through testing it.
Paste into Claude Code and it will do the rest.
Apps and nodes
Questions
Yes. KumoHQ published it free on n8n.io, and it has 74K views. It runs on n8n Cloud or a self-hosted n8n instance.
OpenAI Chat Model. The other 2 nodes are built into n8n.
Similar workflows
NameViews
- AI agent chat780K
- Building Your First WhatsApp Chatbot332K
- Angie, personal AI assistant with Telegram voice and text326K
- Build Your First AI Data Analyst Chatbot134K
- Create a Branded AI-Powered Website Chatbot88K
- Conversational Telegram Bot with GPT-5/GPT-4o for Text and Voice Messages82K
- AI chatbot that can search the web72K
- AI-Powered WhatsApp Chatbot 🤖📲 for Text, Voice, Images & PDFs with memory 🧠71K