AutomationFlowsAI & RAG › Generate SQL Queries from Schema with AI

Generate SQL Queries from Schema with AI

Original n8n title: Generate Sql Queries From Schema Only - Ai-powered (lm Chat Open Ai)

ByYulia @yulia on n8n.io

This workflow is a modification of the previous template on how to create an SQL agent with LangChain and SQLite.

Chat trigger trigger★★★★☆ complexityAI-powered29 nodesOpenAI ChatMemory Buffer WindowMySQLRead Write FileChat TriggerAgent
AI & RAG Trigger: Chat trigger Nodes: 29 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #2508 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json

  

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow is a modification of the previous template on how to create an SQL agent with LangChain and SQLite.

Source: https://n8n.io/workflows/2508/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Generate Sql Queries From Schema Only Ai Powered. Uses lmChatOpenAi, memoryBufferWindow, noOp, mySql. Chat trigger; 29 nodes.

OpenAI Chat, Memory Buffer Window, MySQL +3
AI & RAG

Generate SQL queries from schema only - AI-powered. Uses lmChatOpenAi, memoryBufferWindow, noOp, mySql. Chat trigger; 29 nodes.

OpenAI Chat, Memory Buffer Window, MySQL +3
AI & RAG

Generate SQL queries from schema only - AI-powered. Uses lmChatOpenAi, memoryBufferWindow, noOp, mySql. Chat trigger; 29 nodes.

OpenAI Chat, Memory Buffer Window, MySQL +3
AI & RAG

This workflow enables users to interact with a PostgreSQL database using natural language. It translates text inputs into SQL queries, retrieves the corresponding data, and generates visualizations us

Memory Buffer Window, Read Write File, Chat Trigger +4
AI & RAG

HDW Lead Geländewagen. Uses chatTrigger, lmChatOpenAi, memoryBufferWindow, outputParserStructured. Chat trigger; 92 nodes.

Chat Trigger, OpenAI Chat, Memory Buffer Window +5