๐Ÿ“– AI-powered chatbot workflow with MySQL database integration

โšก 6,820 views ยท ๐Ÿ“– Internal Wiki & Knowledge Base

Description

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 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.


Prerequisites

Before you begin, ensure that you have the following:

  1. An active n8n instance (self-hosted or cloud) running version 1.50.0 or later.
  2. Valid MySQL credentials configured in n8n.
  3. API credentials for the Groq Chat Model (or your preferred AI language model).
  4. Basic familiarity with SQL and n8n node concepts such as chat triggers and memory buffers.
  5. Access to the n8n Docs on AI Agents for further reference.

Workflow Setup

1. Chat Interface & Trigger

2. Conversation Memory

3. AI Agent Core

4. Database Interactions

5. Language Model Processing

6. Guidance & Customization

They help you modify the workflow to suit your environment and requirements.

Workflow Connections

Testing the Workflow

  1. Send a chat message using the chat interface.
  2. Observe how the AI Agent processes the input and generates a corresponding SQL query.
  3. Verify that the MySQL nodes execute the query and return data.
  4. Confirm that the Groq Chat Model produces a coherent natural language response.
  5. Refer to the sticky notes for guidance if you need to fine-tune any node settings.

Next Steps and References


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.

๐Ÿ”— Nodes Used

AI Agent, Simple Memory, Chat Trigger, Groq Chat Model

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup