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.
AI Powered Chatbot Workflow with MySQL Integration This guide shows you how to deploy a chatbot that lets you query your database using natural language. You will build a system that accepts chat m...
@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.mysqltool, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgroq, n8n-nodes-base.stickynote
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 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 MySQL.
Before you begin, ensure that you have the following:
MySQL Node
This node executes the SQL query generated by the AI Agent. You reference the query using an expression (e.g., {{$node["AI Agent"].json.sql_query}}), allowing the agent’s output to control data retrieval.
MySQL Schema Node
This node retrieves a list of base tables from your MySQL database (excluding system schemas). The agent uses this information to understand the available tables.
MySQL Definition Node
This node fetches detailed metadata (such as column names, data types, and relationships) for a specific table. The table and schema names are supplied dynamically by the AI Agent.
They help you modify the workflow to suit your environment and requirements.
Customize Your AI Model
Replace the Groq Chat Model with another language model (such as the OpenAI Chat Model) by updating the node credentials and configuration.
Enhance Memory Settings
Adjust the Chat History node’s context window to retain more or fewer messages based on your needs.
Modify SQL Queries
Update the SQL queries in the MySQL nodes to match your specific database schema and desired data.
Further Reading
Consult the n8n Docs on AI Agents for additional details and examples to expand your workflow’s capabilities.
Set Up a Website Chatbot Copy & Paste and replace the placeholders in the following code to embed the chatbot into your personal or company's website: View in CodePen 🡥
By following these steps, you will deploy a robust AI chatbot workflow that integrates with your MySQL 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 | AI-powered chatbot workflow with MySQL database integration |
|---|---|
| Complexity | intermediate |
| Nodes | 11 |
| Categories | Internal Wiki, AI Chatbot |
| Author | Gegenfeld |
| Published | 23 Feb 2025 |
Use the JSON export at /data/workflows/2985/2985.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.
AI Powered Chatbot Workflow with MySQL Integration This guide shows you how to deploy a chatbot that lets you query your database using natural language. You will build a system that accepts chat m...
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.