Data Processing & Analysis

Translate questions about e-mails into SQL queries and run them

Translate questions about e-mails into SQL queries and run them

Complex
High
26
Nodes
Complex
Trigger
High
Complexity
7/22/2025
Added

Workflow Overview

Total Nodes
26
Node Types
13

Node Types

set
Format empty output, Add table name to output, Combine schema data and chat input, Extract SQL query, Format query results, Add trailing semicolon
6 nodes
sticky Note
Sticky Note2, Sticky Note, Sticky Note1
3 nodes
convert To File
Convert data to binary
1 node
read Write File
Save file locally, Load the schema from the local file
2 nodes
extract From File
Extract data from file
1 node
chat Trigger
Chat Trigger
1 node
manual Trigger
When clicking "Test workflow"
1 node
if
Check if query exists, Check for trailing semicolon, If ran manually, If file exists or already retried generating it
4 nodes
merge
Combine query result and chat answer
1 node
postgres
List all columns in a table, List all tables in a database, Postgres
3 nodes
lm Chat Ollama
Ollama Chat Model
1 node
execute Workflow Trigger
WorkflowTrigger
1 node
agent
AI Agent
1 node

Workflow JSON

23.91 KB
{
  "id": "AC4paL1SXMFURgmc",
  "meta": {
    "instanceId": "8a3ba313628b26e4e4cf0504ff23322f235d6b433d92e59bcf8762764730ed80",
    "templateCredsSetupCompleted": true
  },
  "name": "Translate questions about e-mails into SQL queries and run them",
  "tags": [],
  "nodes": [
    {
      "id": "dd63600a-6bee-43cd-a1d2-87aae2089ed4",
      "name": "Add table name to output",
      "type": "n8n-nodes-base.set",
      "position": [
        840,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "764176d6-3c89-404d-9c71-301e8a406a68",
              "name": "table",
              "type": "string",
              "value": "={{ $('List all tables in a database').item.json.table_name ?? 'emails_metadata'}}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "1bf02b6d-e8e4-4b1b-8ee2-c91a8c390a21",
      "name": "Conve...

Showing first 1000 characters. Click "Expand" to view the full JSON.