Block 1 - When chat message received
- Type / Role
- @n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
- Config choices
- Version 1.1
This workflow is provided as-is. Please review and test before using in production.
This guide shows you how to deploy a chatbot that lets you query your PostgreSQL database using natural language. You will build a system that accepts chat messages, retains conversation history, c...
@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgroq, n8n-nodes-base.stickynote, n8n-nodes-base.postgrestool
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Gegenfeld.
Original n8n.io sourceThis guide shows you how to deploy a chatbot that lets you query your PostgreSQL database using natural language. You will build a system that accepts chat messages, retains conversation history, constructs dynamic SQL queries, and returns responses generated by an AI model. By following these instructions, you will have a working solution that integrates n8n’s AI Agent capabilities with PostgreSQL.
Before you begin, ensure that you have the following:
Chat Interface & Trigger
Conversation Memory
AI Agent Core
Database Interactions
{{$node["AI Agent"].json.sql_query}}), allowing the agent’s output to control data retrieval.public schema, excluding system schemas like pg_catalog or information_schema). The agent uses this information to understand the available tables. This typically involves executing a query like SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';.information_schema.columns, e.g., SELECT column_name, data_type FROM information_schema.columns WHERE table_name = '{{dynamic_table_name}}' AND table_schema = 'public';.Language Model Processing
Guidance & Customization
By following these steps, you will deploy a robust AI chatbot workflow that integrates with your PostgreSQL database, allowing you to query data using natural language.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Query PostgreSQL database with natural language using Groq AI chatbot |
|---|---|
| Complexity | intermediate |
| Nodes | 11 |
| Categories | Internal Wiki, AI Chatbot |
| Author | Gegenfeld |
| Published | 23 Apr 2025 |
Use the JSON export at /data/workflows/3680/3680.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
This guide shows you how to deploy a chatbot that lets you query your PostgreSQL database using natural language. You will build a system that accepts chat messages, retains conversation history, c...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI Chatbot use case.