MySQL Automation Workflows
44 ready-made MySQL workflows for n8n, Make, Zapier, Activepieces, and Pipedream. MySQL-driven workflows: sync rows, run queries, react to data changes.
Natural Language SQL Queries with OpenAI and MySQL
Transform natural language questions into SQL queries using OpenAI's GPT and execute them on your MySQL database. Ideal for users who want to interact with databases without writing SQL.
n8n$4.99Automate Compliance Report Collection with Google Forms, Drive, and MySQL
This n8n workflow streamlines the process of collecting compliance reports submitted via Google Forms. It archives uploaded documents in Google Drive and logs submission metadata into a MySQL database, ensuring efficient storage and easy retrieval.
n8n$4.99Automate MySQL to Google Sheets Data Sync with Duplicate Prevention
This n8n workflow automates the synchronization of new records from a MySQL database to a Google Sheet every 15 minutes, ensuring no duplicates are transferred.
n8n$9.99AI-Powered Chatbot Workflow with MySQL Database Integration
# 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](https://docs.n8n.io/advanced-ai/) for further reference. --- ## Workflow Setup ### 1. Chat Interface & Trigger - **When Chat Message Received**: This node listens for incoming chat messages via a webhook. When a message arrives, it triggers the workflow immediately. ### 2. Conversation Memory - **Chat History**: This memory buffer node stores the last 10 interactions. It supplies conversation context to the AI Agent, ensuring that responses consider previous messages. ### 3. AI Agent Core - **AI Agent (Tools Agent)**: The AI Agent node orchestrates the conversation by receiving the chat input and conversation history. It dynamically generates SQL queries based on your requests and coordinates calls to external tools (such as MySQL nodes). ### 4. Database Interactions - **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. ### 5. Language Model Processing - **Groq Chat Model**: This node connects to the Groq Chat API to generate text completions. It processes the combined input (chat message, context, and data fetched from MySQL) and produces the final response. ### 6. Guidance & Customization - **Sticky Notes**: These nodes provide guidance on: - Switching the chat model if you wish to use another provider (e.g., OpenAI or Anthropic). - Adjusting the maximum token count per interaction. - Customizing the SQL queries and the context window size. They help you modify the workflow to suit your environment and requirements. ### Workflow Connections - The **Chat Trigger** passes the incoming message to the **AI Agent**. - The **Chat History** node supplies conversation context to the AI Agent. - The **AI Agent** calls the MySQL nodes as external tools, generating and sending dynamic SQL queries. - The **Groq Chat Model** processes the consolidated input from the agent and outputs the natural language response delivered to the user. ### 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 - **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](https://docs.n8n.io/advanced-ai/) 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](https://codepen.io/olemai/pen/RNwPdVp) --- 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.
n8n$9.99Store Gmail Email Details in MySQL Database
## This workflow processes emails received in Gmail and saves detailed information about each email to a MySQL database. ### Before using, you need to have: - Gmail credentials - MySQL database credentials - A table in your database with the following columns: - messageId (Gmail message ID) - threadId - snippet - sender_name (nullable) - sender_email - recipient_name (nullable) - recipient_email - subject (nullable) ### How it works: - The Gmail Trigger listens for new emails (checked every minute). - A Code Node extracts the following fields from each email: - Sender's name and email - Recipient's name and email - The MySQL Node inserts the extracted data into your database. - If an entry with the same sender email already exists, it updates the record with the new details. ### How to use: - Make sure your database table has all required columns listed above. - Select the appropriate table and configure the matching column (e.g., id) to avoid duplicates. ### Customizing this Workflow: - You can further modify the workflow to store attachments, timestamps, labels, or any other Gmail metadata as needed.
n8n$4.99Automatically Store Gmail Contacts in MySQL Database
This workflow captures sender information from Gmail emails and stores it in a MySQL database, ensuring you maintain an up-to-date contact list.
n8n$4.99Complete LAMP Stack (Linux, Apache, MySQL, PHP) Automated Server Setup
This automated n8n workflow enables the rapid setup of a complete LAMP (Linux, Apache, MySQL, PHP) stack on a Linux server, executing the entire process in approximately 10 seconds. It configures the server, installs necessary components, and sets up a development user for seamless operation. ## Fundamental Aspects - **Start** - Initiates the workflow - **Set Parameters** - Configures server parameters - **System Preparation** - Prepares the system for LAMP installation - **Update System** - Updates the system and installs essential packages - **Install Apache** - Sets up the Apache web server - **Install MySQL** - Installs MySQL and phpMyAdmin - **Install PHP & Extensions** - Installs PHP with required extensions - **Install Development Tools** - Adds development utilities - **Create Development User** - Creates a dedicated user for development - **Final Setup & Configuration** - Finalizes configurations - **Setup Completion** - Provides a summary of the setup ## Setup Instructions - Import the workflow into n8n - Configure parameters in the Set Parameters node - Run the workflow - Verify the LAMP stack setup on the server ## Required Resources - Linux server with SSH access - Root-level administrative privileges ## Features - Install Database Server - Deploys MySQL with phpMyAdmin - Configure Web Server - Sets up Apache for web hosting - Install PHP - Includes PHP with essential extensions - Create Development User - Establishes a user for development tasks ## Parameters to Configure - server_host: Your Linux server IP address - server_user: SSH username (typically root) - server_password: SSH password - php_extensions: List of PHP extensions to install - dev_tools: List of development tools to install - username: Development username - user_password: Password for the development user ## Workflow Actions - Install: Deploys the LAMP stack, configures Apache, MySQL, and PHP - Create User: Sets up a development user with appropriate permissions - Configure: Finalizes server settings and tool installations The workflow automatically manages - Ubuntu/Debian package installation - Service startup and configuration - Web server and database setup - User and permission management - Development tool integration Update the parameters in the Set Parameters node with your server specifics and run the workflow!
n8n$14.99Automate PostgreSQL & MySQL Management on Linux Servers
This n8n workflow automates the installation, configuration, and management of PostgreSQL and MySQL databases on Linux servers, enabling efficient setup, creation, and deletion of databases with user access in just 10 seconds.
n8n$9.99Automate Your Document Processing with Mysqltool and Webhooks
Streamline your document processing by automating tasks with Mysqltool and webhook integrations for improved productivity.
n8n$17.76Automate MySQL Data Purging with Cron Scheduling
This workflow automates the deletion of old execution records from a MySQL database using a scheduled cron job.
n8n$11.67MySQL: Create Table and Insert Sample Data
Demonstrates creating a MySQL table and inserting data via n8n. Ideal for learning database automation basics.
n8n$4.99Automate Google Sheets Data Entry with MySQL and Cron Scheduler
This workflow automates the process of fetching data from a MySQL database and appending it to a Google Sheets document on a weekly schedule.
n8n$18.29Compliance Report Collector: Google Form → Drive + MySQL
Automates compliance report collection from Google Forms, archiving files to Google Drive and logging metadata to MySQL for seamless auditing and storage.
n8n$13.99Two-Way Sync Between Pipedrive and MySQL
This workflow automates a two-way sync of customer data between Pipedrive and MySQL. It will create new records in one source if it only exists in the other. Where matching records have different data for name, phone number, or email address, it will sync the most recently updated version.
n8n$9.99Automatically Add Gmail Sender Contacts to MySQL Database
Automates capturing sender name and email from new Gmail messages and stores them in MySQL, inserting new contacts or updating existing ones based on email.
n8n$11.99Automate CSV Data Import into MySQL Database
This workflow automates the process of importing data from a CSV file into a MySQL database, streamlining data management tasks.
n8n$4.99Automated MySQL Table Creation and Data Insertion Workflow
This workflow automates the process of creating a MySQL table and inserting specified data, streamlining event management tasks.
n8n$19.17Automate Purging of n8n Execution History in MySQL
This workflow automatically deletes n8n execution history entries older than 30 days from a MySQL database, helping to manage database size effectively.
n8n$3.99Automated Weekly Project Cost Reports with MySQL and Outlook HTML Emails
Automates weekly MySQL queries for projects missing cost data, generates HTML reports, and sends targeted Outlook emails based on cost centers like Retail, Service, and Projects.
n8n$14.99Import data from MySQL into Google Sheets
Automates weekly queries from a MySQL table (e.g., books) and appends results to Google Sheets for easy analysis.
n8n$5.99Compare Two SQL Datasets from MySQL
Compares two SQL query results from a MySQL database, identifying matching, differing, unique records across time periods.
n8n$11.99Integrate and Unify Data from MySQL and PostgreSQL
This workflow retrieves and merges data from MySQL and PostgreSQL databases, providing a unified data output for further processing.
n8n$4.99Sync Google Sheets Data with MySQL Database
Automates bidirectional sync between Google Sheets form responses and MySQL, handling status updates, comparisons, and scheduled runs for data consistency.
n8n$22.99Two-Way Pipedrive ↔ MySQL Contact Sync
Automates bidirectional sync of customer contacts between Pipedrive CRM and MySQL DB. Creates missing records and updates name, phone, email with most recent data.
n8n$14.99
More integrations
Custom AI Systems & Services
Our team of experienced AI builders will help build custom AI systems, workflows, and solutions.
Request Custom Work