WorkflowSQLOpen

Generate SQL queries from schema only - AI-powered

Triggered manually or by an app event. Connects Condition, Convert To File, Extract From File, MySQL, Read Write File, Stop And Error. Run this part only once This section: loads a list of all tables from the database hosted on [db4free]({{ $env.WEBHOOKURL }} extracts the database schema for each table and adds the table name converts the schema into a binary JSON format saves the schema ./chinook

Front matter
name: Generate SQL queries from schema only - AI-powered
description: Triggered manually or by an app event. Connects Condition, Convert To File, Extract From File, MySQL, Read Write File, Stop And Error. ## Run this part only once This section: * loads a list of all tables from the database hosted on [db4free]({{ $env.WEBHOOK_URL }} * extracts the database schema for each table and adds the table name * converts the schema into a binary JSON format * saves the schema `./chinook_mysql.json` file locally ***Now you can use chat to "talk" to your data!*** πŸŽ‰ ## Pre-workflow setup Connect to a free MySQL server and import your database. Follow Step 1 and 2 in this [tutorial]({{ $env.WEBHOOK_URL }}
category: Automation
kind: Workflow
software: Condition|Convert To File|Extract From File|MySQL|Read Write File|Stop And Error

Generate SQL queries from schema only - AI-powered

Triggered manually or by an app event. Connects Condition, Convert To File, Extract From File, MySQL, Read Write File, Stop And Error. ## Run this part only once This section:

  • loads a list of all tables from the database hosted on [db4free]({{ $env.WEBHOOK_URL }}
  • extracts the database schema for each table and adds the table name
  • converts the schema into a binary JSON format
  • saves the schema ./chinook_mysql.json file locally

Now you can use chat to "talk" to your data! πŸŽ‰ ## Pre-workflow setup Connect to a free MySQL server and import your database. Follow Step 1 and 2 in this [tutorial]({{ $env.WEBHOOK_URL }}

Steps

  • OpenAI Chat Model (noOp)
  • Window Buffer Memory (noOp)
  • No Operation, do nothing (noOp)
  • List all tables in a database (mySql)
  • Extract database schema (mySql)
  • Add table name to output (set)
  • Convert data to binary (convertToFile)
  • Save file locally (readWriteFile)
  • Extract data from file (extractFromFile)
  • Chat Trigger (noOp)
  • AI Agent (noOp)
  • Sticky Note (stickyNote)
  • Sticky Note1 (stickyNote)
  • When clicking "Test workflow" (manualTrigger)
  • Sticky Note2 (stickyNote)
  • Sticky Note3 (stickyNote)
  • Combine schema data and chat input (set)
  • Load the schema from the local file (readWriteFile)
  • Extract SQL query (set)
  • Check if query exists (if)
  • Sticky Note4 (stickyNote)
  • Sticky Note5 (stickyNote)
  • Sticky Note7 (stickyNote)
  • Sticky Note6 (stickyNote)
  • Sticky Note8 (stickyNote)
  • Format query results (set)
  • Run SQL query (mySql)
  • Prepare final output (set)
  • Combine query result and chat answer (merge)
  • Error Handler (stopAndError)

Import

Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).

Source: https://github.com/Zie619/n8n-workflows/blob/main/Extractfromfile/1472_Extractfromfile_Converttofile_Create_Triggered.md

Author: Zie619, n8n workflow collection. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.