N8n sql agent example. db' node. /// note | Feature removed n8n removed this functionality in February 2025. io. Follow technical documentation to integrate the Tools Agent into your workflows. It can be any database tool you need or even a “Call workflow” tool to call a subworkflow. Simplify your automation tasks with ready-made solutions tailored to your needs. Looking at the logs, I see the agent correctly query for the table structure and then correctly create the SQL query needed to answer my question. And if you prefer to keep the data private, you can manually execute the generated SQL query in your own environment using any database client or tool you trust 🗄️ 💭 The AI Agent memory node does not store the actual data as we run SQL-queries outside the agent. Dec 27, 2024 · Learn how to implement intelligent, adaptive AI agentic workflows in n8n. SQL Agent: Processes queries using SQL on structured data. Documentation for Microsoft SQL credentials. From single agents to multi-agent teams: discover key patterns for advanced automation! Feb 20, 2025 · Describe the problem/error/question The SQL Agent bot is not working and I’m not sure what I’m doing wrong. Search, filter and discover templates to kickstart your automation. n8n sanitizes data in query parameters, which prevents SQL injection. n8n lets you seamlessly import data from files, websites, or databases into your LLM-powered application and create automated scenarios. 1k次,点赞11次,收藏24次。 [AI]n8n快速上手 — — 构建AI Agent工作流_n8n使用案例 Copy Main Agent system message to your primary AI node Copy Sub-Agent system message to your SQL generator node Connect the sub-workflow between both agents 4️⃣ Test & Deploy Test with sample queries like "Show me 5 recent items" Verify query limits work (max 50 results) Deploy and monitor performance 🎯 Why Use This Workflow? Integrate Headless Testing with Microsoft SQL using n8n. Mar 13, 2025 · SQL Tutorial | Store All Data Types with Agentic RAG in n8n Tutorial: Understanding Agentic Rag (ARAG) and its Applications Introduction Today, we're going to discuss Agentic Rag (ARAG), a type of natural language processing (NLP) that's been gaining popularity. I would like to use Ollama. The agent can understand natural language queries and interact with a SQLite database to provide accurate answers. This video demonstrates how to chat with your SQL (MySQL/PostgreSQL) databases using a powerful and reliable SQL AI Agent + RAG combo built with n8n 🚀🌟 You Feb 25, 2025 · I am using n8n to build an AI agent to answer questions from a MS-SQL database. Requirements You’ll need an n8n API key. 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. Using n8n Getting started Quickstarts The very quick quickstart This quickstart gets you started using n8n as quickly as possible. Create sophisticated automations between Microsoft SQL and your stack using n8n. Can anyone help me? My workflow consists of the following parts: Trigger: Chat Trigger AI Agent as Tool Agent → Chat By the end, you’ll have a fully functional AI agent that can connect to any SQL database and generate insights instantly. In this tutorial, we'll show you how to build an AI-powered SQL agent using n8n to answer questions about your database effortlessly! 🚀 You'll learn how to May 5, 2025 · Okay, this n8n tutorial on building an AI-powered SQL agent? Seriously inspiring stuff and right up my alley! It walks you through creating a chatbot that translates natural language questions into SQL queries, hitting a Postgres database (Supabase in this case). You can find the trigger node docs here. Extract, transform, and load data from n8n to MS SQL Server without any hassle. Powered by LangChain's SQL Agent capabilities and OpenAI's GPT-4-turbo model, the agent translates your natural language Mar 19, 2025 · Discover what AI agents are, explore 5 key types, and see 15 real-world examples of AI agents automating tasks like data analysis and customer support. The term 'Rag' seems to be shifting with the release of larger context Windows, and n8n is a workflow automation platform that gives technical teams the flexibility of code with the speed of no-code. It includes a multi-agent workflow that enables: Real-time chat with local LLMs Memory storage and vector embeddings using PGVector Integrate n8n to MS SQL Server in minutes with Airbyte. It dynamically generates SQL queries based on user requests, streamlining data retrieval and analysis. Mar 26, 2025 · And then installed the n8n-nodes-oracle-database-parameterization module which seems to be the most advanced of the Oracle Database connectors. Example Usage "Which workflows are using Slack and Google Calendar?" "Which workflows have AI in their name but are not using openAI?" How it works Using the n8n API, it fetches all workflow May 6, 2025 · Learn how to use n8n to build AI agents that automate email processing and create a retrieval-augmented generation (RAG) agent for document question answering. By following these instructions, you will have a working solution that It blows my mind. Unlike traditional vector database solutions that falter with numerical queries, this template leverages PostgreSQL for efficient data storage and an AI agent to dynamically create optimized SQL queries from natural language Jan 1, 2025 · The AI agent is instructed to perform SQL queries against our workflow credential table when asked about credentials by the user. Learn how to use the ReAct Agent of the AI Agent node in n8n. 4K subscribers Subscribe A secure implementation of an AI-powered SQL query generator using N8N and LangChain. So, does anyone know how to make the SQL Agent flow work? Mar 12, 2025 · Honestly, I feel like I am going crazy… I just decided to try out n8n, and after watching numerous videos, searching the documentation, and everything, I cannot seem to figure out how to convert the AI agent to an SQL agent. But the answer contains only made up information (like John doe for names and random dates). Made a Slack agent that can basically do everything, in half an hour. Jun 22, 2025 · AI Agent Workflow Automation with Ollama, n8n, and PGVector This project is a powerful local Generative AI automation system built with Ollama, n8n, and PostgreSQL + PGVector, all running in Docker. Agent uses these tool to form and run sql query which are necessary to answer the questions. In this tutorial, you will: Load a workflow from the workflow Mar 11, 2025 · My goal was to build a hybrid long-term memory for an Agent that uses both a traditional SQL database and a vector database. May 10, 2025 · AI Agent Architectures: The Ultimate Guide With n8n Examples 8 AI Agent Configurations. Is there a way to reuse the postgre credentials instead of defining new hardcoded ones in the agent tool to connect to the db? is there any specific code for the postgre connectivity (better python or JavaScript?) End goal is to take simple query, agent to list the table and run the select query itself. Automate Data Operations: Use the node to automate interactions with your database, such as running queries on schedule Nov 5, 2024 · Master AI nodes in n8n to enhance workflow automation and efficiency. How it works Each time user ask's question using the n8n chat interface, the workflow runs. Create sophisticated automations between MySQL and your stack using n8n. Activate the workflow. It doesn't include detailed explanations or explore concepts in-depth. Create an AI Agent that Writes SQL Queries for You (n8n and MCP) AI Luke 12. Many people find it easier to take in new information in Explore 4411 automated workflow templates from n8n's global community. io- workflow from A to Z, solving a concrete… Learn how to build AI agents seamlessly with n8n, guiding you from beginner concepts to expert techniques. Here’s how you can implement this: Nov 5, 2023 · The main difference is that n8n expects a match between your field names in n8n and your column names in SQL Server (meaning you might need to use Rename Keys or the Set node to get these right before your actual Microsoft SQL node), simply because the SQL Server node is a bit older than the current MySQL node. This template is for Self-Hosted N8N Instances only. 9 Best Practices. Use query parameters When creating a query to run on a Postgres database, you can use the Query Parameters field in the Options section to load data into the query. To use the sample database, manually run the workflow once using the 'When clicking "Test workflow"' trigger. To use your own database, upload it to your n8n data directory and update the file path in the 'Load local chinook. Components Model – Required Memory – Optional Tool (s) – Optional Output Parser – Optional Templates Allow your AI to call an API to fetch data Chat with a Google Sheet using AI Nov 7, 2024 · In this live build, I’m tackling a question from one of the members of my community: How do you build an AI-powered SQL agent using n8n? Apr 24, 2025 · Hello, I want to use a simple n8n workflow to query my local MS SQL Server database via chat message. Unlike standard RAG which only performs simple lookups, this agent can reason about your knowledge base, self-improve retrieval, and dynamically switch between different tools based on the specific question. If the question includes a visualization aspect, the SQL Agent alone may not respond accurately. Apr 16, 2025 · Hi everyone, I’m trying to build an AI Agent in n8n that can autonomously query a PostgreSQL database with multiple joined tables. Table of Contents Pre-conditions and Requirements It blows my mind. It acts as an intelligent AI Agent, enabling you to query data, understand database schemas, and perform data analysis using simple English. It is also aware of this issue and fixes it, but the query is always done wrong. Whether you have used n8n before, or this is your first time, we will show you how the building blocks of AI workflows fit together and construct a working AI-powered chat agent which you can easily customize for your own purposes. May 13, 2025 · 文章浏览阅读2. Output Guardrail Agent: Validates queries and ensures that the responses remain on-topic and accurate. Integrations Built-in nodes Actions MySQL MySQL node Use the MySQL node to automate work in MySQL, and integrate MySQL with other applications. Oct 24, 2024 · Action: list-tables-sql Action Input: Observation: items, customers, orders, order_items Thought: I should look at the schema of the items table to see what columns are available. Jan 19, 2025 · While searching for an efficient way to connect Oracle databases to n8n, many users stumbled upon the original n8n-nodes-oracle plugin. Create sophisticated automations between Postgres and your stack using n8n. I have tried using the SQL Agent connected to Postgres, but I just get sample data back which is strange. Create sophisticated automations between Text Classifier and your stack using n8n. This n8n demonstrates how to build a simple SQLite MCP server to perform local database operations as well a Integrate Text Classifier with hundreds of other apps. I create an AI Agent. Please use the Tools Agent connected to a tool that will execute the SQL request. Contribute to NickKornienko/n8n development by creating an account on GitHub. Learn how to use the Microsoft SQL node in n8n. Mar 13, 2025 · Hey @wsdevtime , SQL agent is being deprecated. Unlock Conversational Database Insights with this AI Agent This n8n workflow transforms how you interact with your SQLite databases. The agent builds a SQL query based on the natural language query in the prompt. Feb 13, 2025 · In this post, we explore how to set up n8n’s Agentic AI framework on a local machine to process queries against a PostgreSQL database, applying AI-driven SQL generation for an intelligent data Build an AI chat agent with n8n Welcome to the introductory tutorial for building AI workflows with n8n. Use these credentials to authenticate Microsoft SQL in n8n, a workflow automation platform. (Note this is a 3rd party module — Oracle does not Apr 24, 2024 · The main database I am working with is a Microsoft SQL database. This workflow empowers users to interact with a database conversationally through an AI-powered agent. Follow technical documentation to integrate AI Agent node into your workflows. I was hating on no-code tools my whole life, but n8n changed everything. Oct 3, 2024 · I’m having issues with the SQL Agent. Learn how to use the SQL Agent of the AI Agent node in n8n. g. My goal is to enable the AI Agent to: Understand which tables are available Know the structure of these tables (columns and data types) Generate and execute valid SQL queries My idea was to create the following 3 Tool Nodes: Execute SQL Query Get DB Schema and Oct 10, 2024 · Understanding n8n AI Agents: Discover what AI Agents in n8n are and how they function. Follow technical documentation to integrate the SQL Agent into your workflows. For example, you want to find a person by their email This n8n workflow empowers you to query structured financial data from Google Sheets or CSV files using AI-generated SQL. Nov 25, 2024 · Conclusion In this tutorial, you learned how to create an SQL AI agent capable of querying tables in a Postgres database. Its allows you to try out the UI and introduces two key features: workflow templates and expressions. Use this node to interact with the PGVector tables in your Postgresql database. Let’s dive in! Set up your Vector Database Schema Create Documents Table and Match Function First of all n8n AI agent examples. This n8n workflow demonstrates how to create an agent using LangChain and SQLite. The example gave an error here and even changing the prompt I cannot do it. I’ve created my first working concept using n8n. I have the credentials saved in n8n, but can’t seem to make it work with the existing SQL Agent. Mar 4, 2025 · The agent only reply with “made up” information. Integrate Microsoft SQL with MySQL using n8n. Mar 3, 2024 · SQL Agent – The SQL Agent uses a SQL database as a data source. The examples cover common use cases and highlight different features of advanced AI in n8n. Here’s a quick example workflow: Integrate Microsoft SQL with hundreds of other apps. With 400+ integrations, native AI capabilities, and a fair-code license, n8n lets you build powerful automations while maintaining full control over your data and deployments. Refer to AI Agent for more In this tutorial, we'll show you how to build an AI-powered SQL agent using n8n to answer questions about your database effortlessly! 🚀 You'll learn how to create a chatbot that generates SQL Related resources n8n provides a trigger node for Postgres. Dec 1, 2024 · I see people using SQL Agent but when i do the exact same thing, it’s not working ! I’m pretty mad after 2 days on basic topic, thus i’m looking for help. This downloads and saves the chinook. 👋🏻 About Me Hi! Dec 4, 2024 · Hi, I’m trying to create a simple ai sql assistant with ai agent. Jun 11, 2024 · Hey everyone, In this blog we are going to see how you can create API Endpoints that perform SQL query on MySQL server. It downloads the example SQLite database, extracts from a ZIP file and saves locally (chinook. Using the AI Agent Node in n8n: A step-by-step guide on utilizing the AI Agent Node n8n effectively. Nov 21, 2024 · I want to use the SQL agent to query a supabase database. There must be something internal to the node Learn how to use the Tools Agent of the AI Agent node in n8n. You will build a system that accepts chat messages, retains conversation history, constructs dynamic SQL queries, and returns responses generated by an AI model. Integrations Built-in nodes Cluster nodes Root nodes PGVector Vector Store node PGVector is an extension of Postgresql. The workflow uses cached database schema and AI to generate SQL queries for an online shop database system, all running on your local machine. When I select the AI agent all i see in configuration is this: when watching videos I see this option where you actually select your agent: I’ve tried adding a Learn how to use the AI Agent node in n8n. Sep 15, 2024 · Capabilities of the SQLite3 Node Database Connection: Connect to multiple SQLite3 database by specifying the database file name and location. , Google Gemini), the workflow converts natural language commands into API calls, enabling seamless management of your Proxmox nodes, VMs, and clusters. Whether you’re a developer, data enthusiast, or AI tinkerer, this guide will walk you through every step of building an AI that thinks before it speaks. I configure it to connect to Postgres, and it returns a successful connection. Follow technical documentation to integrate Microsoft SQL node into your workflows. I have the workflow setup and have connected to the database successfully. You can insert documents into a vector table, get documents from a vector table, retrieve documents to provide them to a retriever connected to a chain, or connect directly to an agent as a tool Unlock the full potential of your SQL databases with an intelligent trio of AI agents that transform complex data into actionable visualizations. Discover how to create AI agents using n8n: use a no-code/low-code platform to build robust workflows for AI and beyond. 11 Agent Prompting Principles. The example in the tutorial used Supabase. However, by leveraging AI-driven workflows, we can simplify this process, allowing users to interact with databases using natural language on N8N. You’re essentially building a smarter, conversational interface to your data. How it works Information Extraction: The Information Extractor identifies and extracts the user's question. This project is a local implementation of the N8N SQL Agent Template with MySQL DB connection and different prompt, adapted to work with an online shop database. This template provides a complete implementation of an Agentic RAG (Retrieval Augmented Generation) system in n8n that can be extended easily for your specific use case and knowledge base. Veremos desde la instalación de n8n hasta la integración con LLMs (GPT-4, Llama 2), implementaremos una arquitectura RAG completa (ingesta de datos, generación de embeddings, base vectorial, búsqueda semántica y generación de respuestas . This n8n workflow is a fun way to query and search over your credentials on your n8n instance. Tired of wrestling with messy databases and confusing SQL queries? Built by 2024 n8n community award winner, our powerful AI Automation template combines three specialized ag Integrate MySQL with hundreds of other apps. db). Explore the comprehensive directory of n8n workflow templates. Every time I run the Agent, it returns “I don’t know” to my question. Further Reading: Consult the n8n Docs on AI Agents for additional details and examples to expand your workflow’s capabilities. During this… A quick example to try out n8n. It translates text inputs into SQL queries, retrieves the corresponding data, and generates visualizations using QuickChart, facilitating seamless data analysis without manual query writing. This step-by-step guide demonstrates how to connect to any knowledge source, index it in a vector database, and create an AI-powered chatbot that provides accurate, context-aware answers. Free and source-available. On this page, you'll find a list of operations the MySQL node supports and links to more resources. Follow technical documentation to integrate the ReAct Agent into your workflows. By integrating Proxmox APIs and generative AI models (e. Jun 13, 2024 · Utilising the n8n API with HTTP node pagination example Creating ephemeral SQLite databases with Code node Building AI Agent with tools - in particular, an SQL tool which uses an SQLite database. Jun 27, 2025 · n8n ai agent workflows, features, use cases, pricing, integration tips, prompt design, architecture, expert workflows, Reddit insights, and comparisons. It provided a straightforward solution but lacked ongoing maintenance. Nov 2, 2024 · Describe the problem/error/question When using SQL agent node, even with models that works in other platforms for this scope, there is a consistent issue: when making SQL queries, the agent always misses the last ’ (as can be seen from the last node output below). This n8n demonstrates how to build a simple PostgreSQL MCP server to manage your PostgreSQL database such as HR, Payroll, Sale, Inventory and More!This MCP exam Sep 19, 2024 · Integrate Microsoft SQL with Postgres using n8n. This blog explores how an automated workflow enhances database accessibility by Jan 5, 2025 · This is part 1 of a planned 3 part series, explaining the setup and the details of an n8n. /// The SQL Agent uses a SQL database as a data source. I need the AI to generate the SQL query an Integrate Postgres with hundreds of other apps. Execute SQL Queries: Perform basic SQL operations like CREATE, SELECT, INSERT, UPDATE, and DELETE from within your n8n workflow. 💪 🚀 Setup Run the top part of the workflow once. Advanced AI Examples and concepts Advanced AI examples and concepts This section provides explanations of important AI concepts, and workflow templates that highlight those concepts, with explanations and configuration guides. Discover tools, agents, and advanced nodes for optimal performance. RAG Agent: Performs vector-based searches on document-like data. Does anyone know how to make the connection? Use AI Agent to easily build AI-powered applications and integrate them with 422+ apps and services. Conversational PostgreSQL Agent with Visuals, Multi-KPI, and Data Editing (MCP) Ask your PostgreSQL database complex questions and receive clear summaries, charts, and even update or insert data — all through one smart agent powered by n8n’s Model Context Protocol (MCP). Good to know Your credentials should remain safe as this workflow does not decrypt or use any decrypted data. Jan 21, 2025 · Learn how to build powerful RAG chatbots with n8n's visual workflow automation. I connect the “OpenAI Chat Model” as the Model for the SQL Agent. For example, you can integrate AI tools like OpenAI with n8n to automate tasks, generate content, or analyze data seamlessly. By connecting various AI nodes within n8n, you can create complex workflows that utilize AI functionalities to improve efficiency and effectiveness. Apr 28, 2025 · In this article, I’ll show you how to build your own Agentic RAG from scratch using n8n, a powerful low-code automation platform. It uses the native SQL Agent that works well and adds visualization capabilities thanks to OpenAI’s Structured Output and Quickchart. I c… Mar 27, 2025 · Querying databases often requires technical expertise in SQL, making it challenging for non-technical users to retrieve information efficiently. It can understand natural language questions, convert them into SQL queries, execute the queries, and present the results in a user-friendly format. Here you can see an example with Google Sheets: Build Your First AI Data Analyst Chatbot | n8n workflow template Just change the Sheets tools for a database of your choice Conversational Data Retrieval and Visualization Workflow This workflow enables users to interact with a PostgreSQL database using natural language. n8n offers powerful AI capabilities that can enhance your AI workflows. The workflow itself is running only the SQL statements are not created and passed to the MS SQL Node. SQL AI Agent 节点 SQL Agent 使用 SQL 数据库作为数据源。它可以理解自然语言问题,将其转换为 SQL 查询,执行查询,并以用户友好的格式呈现结果。此代理对于构建数据库的自然语言接口很有价值。 请参考 AI Agent 获取有关 AI Agent 节点本身的更多信息。 节点参数 使用以下参数配置 SQL Agent。 Data Source Jan 12, 2025 · I am unable to use the Sql Agent function because I cannot understand how it works. Feb 10, 2025 · This guide explains the fundamentals of AI agents and shows you how to build them using n8n, with practical examples for software developers. n8n has built-in support for a wide range of MySQL features, including executing an SQL query, as well as inserting, and updating rows in a database. 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. I have an idea of the problem but don’t know ho to solve it. Mar 16, 2025 · En este tutorial crearemos paso a paso un agente autónomo RAG (Retrieval-Augmented Generation) usando n8n como plataforma de automatización integral. Modify SQL Queries: Update the SQL queries within the PostgreSQL nodes or refine the prompts for the AI Agent to ensure they match your specific database schema and desired data, adhering to PostgreSQL syntax. Exploring Different Types of AI Agents: Learn about the various AI Agents available, when to use them, and why. db file. I could not find a Customizable AI Agents: AI Agent Router: Determines the query type and routes it to the appropriate agent. Accessing and analyzing database data often requires SQL expertise or dedicated reports, which can be time-consuming. This workflow generates SQL queries based solely on database schema, ensuring data privacy by never exposing ac This template automates IT operations on a Proxmox Virtual Environment (VE)using an AI-powered conversational agent built with n8n. Design automation that extracts, transforms and loads data between your apps and services. Mar 24, 2025 · Yes, it’s possible to perform a regular SQL query search in a vector database table and then use a prompt to search by vectors using the AI Agent node in n8n. Sep 27, 2024 · In this n8n AI Agent tutorial you will learn how to create a RAG Chatbot that can answer questions from your own knowledge base. 3 Agentic RAG Architectures. This agent is valuable for building natural language interfaces to databases. - In this example, the AI Agent does not need to create the SQL query. The SQL database helps search for memories related to specific time ranges, while the vector database enables semantic search capabilities. N8N runs under Docker locally on my computer. No Coding. uyizcbu sehi ajw tpoej vejrtzgv ugvyw fuxd eswr appfd mxgmoy
|