Generate SQL Queries from Schema Only — n8n AI Agent Template
Input: natural language question + local database schema file → Processing: AI Agent generates SQL based solely on schema (no data access) → Output: SQL query and execution results (or direct answer)
Read the case’s method and prerequisites
Requires an n8n instance; configure openAiApi and mySql credentials. Before first run, prepare a MySQL server and import your database (the template example uses Chinook, available on GitHub). Execute the top half of the workflow once to fetch and save the schema locally. Subsequent chat triggers read this local file instead of reconnecting to the remote database.
n8n · mysql
Associated by case tags. Verify costs, permissions and actual results in the case.