{
  "name": "Conversing with data: transforming text into SQL queries and visual curves",
  "nodes": [
    {
      "id": "5207b91b-5a29-4786-93e2-c7ba4bd1d0f1",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        340,
        360
      ]
    },
    {
      "id": "8571a134-1a79-4858-aa22-82a037a3a5f8",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1080,
        460
      ]
    },
    {
      "id": "967fd040-bb82-4e97-a979-b1e91ef54b8f",
      "name": "Add table name to output",
      "type": "n8n-nodes-base.set",
      "position": [
        -380,
        -60
      ]
    },
    {
      "id": "80d47d3e-476e-43fd-a021-609cdad537c8",
      "name": "Save file locally",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -40,
        -60
      ]
    },
    {
      "id": "8e715321-38a3-4ba6-abac-efe2ad54a039",
      "name": "Extract data from file",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -360,
        460
      ]
    },
    {
      "id": "d0f9eb57-2226-4b4a-b7e7-b09074f5c410",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -860,
        460
      ]
    },
    {
      "id": "b05e11f0-f957-4067-85fc-35bded780b59",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        220,
        140
      ]
    },
    {
      "id": "f91029ec-27e5-4f1d-aec8-711ef5a7e0e4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -340
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "95f41622-0ff4-4841-a83d-265864599f2f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -320
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b12dbb8a-48fe-4627-b209-916191aef4e6",
      "name": "When clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -900,
        -60
      ]
    },
    {
      "id": "3044a292-9596-40dd-96a5-caeed0204630",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        180
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "a6691f03-8688-4844-85be-b4344e9010bf",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -320
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "002bf810-5408-40a1-a05d-9bdcab64a14c",
      "name": "Combine schema data and chat input",
      "type": "n8n-nodes-base.set",
      "position": [
        -120,
        460
      ]
    },
    {
      "id": "64b73d55-e01a-4777-a07c-6fb047d22666",
      "name": "Load the schema from the local file",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -620,
        460
      ]
    },
    {
      "id": "c016cffe-669b-418f-818f-cb3692c7dcdb",
      "name": "Extract SQL query",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        380
      ]
    },
    {
      "id": "3a9d2623-751d-4b62-9fb7-68d5d9c8facf",
      "name": "Check if query exists",
      "type": "n8n-nodes-base.if",
      "position": [
        840,
        380
      ]
    },
    {
      "id": "552385b5-1086-419d-b0b8-f7fa2479c13f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        -60
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "4ea865a5-7988-4563-9d5a-a7f4a4f9c31f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        -60
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0a25db4f-cc81-46f1-93cb-9e3d4028516d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        560
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "66492a65-1553-4286-80ea-d03e631a0995",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -40
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "73839265-f77a-4856-b1fb-b2be7f6ebe27",
      "name": "Format query results",
      "type": "n8n-nodes-base.set",
      "position": [
        1180,
        180
      ]
    },
    {
      "id": "e9220e4e-8bdc-48ed-b29b-a2fe124b8b72",
      "name": "Prepare final output",
      "type": "n8n-nodes-base.set",
      "position": [
        2140,
        580
      ]
    },
    {
      "id": "81a292e1-c5e9-40df-a181-66f767c60215",
      "name": "Combine query result and chat answer",
      "type": "n8n-nodes-base.merge",
      "position": [
        1880,
        580
      ]
    },
    {
      "id": "4a35ebb4-37cb-4a7c-b005-70315c6f684c",
      "name": "List all tables in a database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -740,
        -60
      ]
    },
    {
      "id": "22da4137-af07-4c03-9c2d-6b8178571ff4",
      "name": "Convert data to Json",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -200,
        -60
      ]
    },
    {
      "id": "0d7d1e90-224b-4159-8930-4470b140305d",
      "name": "Schema Extractor",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -560,
        -60
      ]
    },
    {
      "id": "ddba033b-aca0-42a0-b553-3edf4d93cd1f",
      "name": "Final SQL result",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1000,
        180
      ]
    },
    {
      "id": "3c2b1a0d-4a50-44b2-ada9-00d3b23b3c61",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1440,
        180
      ]
    },
    {
      "id": "4ad38866-185e-4cd3-b0b0-b1e744d52204",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1900,
        420
      ]
    },
    {
      "id": "744b6680-310b-4a89-a84c-dc59145fe73f",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        2120,
        180
      ]
    },
    {
      "id": "196473ba-78c5-412c-8940-121a0e1f28d2",
      "name": "plot agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1700,
        180
      ]
    },
    {
      "id": "9e03e081-0de2-4b8e-bcaa-adc0d2240272",
      "name": "deepseek-chat",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1700,
        380
      ]
    },
    {
      "id": "376d0712-00c4-4132-a429-b36234e75316",
      "name": "Deepseek-chat",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        200,
        360
      ]
    },
    {
      "id": "43d27038-22c0-41ec-b2b5-507c311b23f1",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -60
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c206c591-5826-4285-900a-c082587bfbaa",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -40
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "57bbe158-4ddc-4f46-b871-d22735e3f720",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        580
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Extract SQL query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "plot agent": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "plot agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "Load the schema from the local file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Combine query result and chat answer",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Deepseek-chat": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "deepseek-chat": {
      "ai_languageModel": [
        [
          {
            "node": "plot agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Final SQL result": {
      "main": [
        [
          {
            "node": "Format query results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schema Extractor": {
      "main": [
        [
          {
            "node": "Add table name to output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract SQL query": {
      "main": [
        [
          {
            "node": "Check if query exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert data to Json": {
      "main": [
        [
          {
            "node": "Save file locally",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format query results": {
      "main": [
        [
          {
            "node": "Combine query result and chat answer",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Check if query exists": {
      "main": [
        [
          {
            "node": "Combine query result and chat answer",
            "type": "main",
            "index": 1
          },
          {
            "node": "Final SQL result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract data from file": {
      "main": [
        [
          {
            "node": "Combine schema data and chat input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add table name to output": {
      "main": [
        [
          {
            "node": "Convert data to Json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "plot agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "List all tables in a database": {
      "main": [
        [
          {
            "node": "Schema Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Test workflow\"": {
      "main": [
        [
          {
            "node": "List all tables in a database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine schema data and chat input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load the schema from the local file": {
      "main": [
        [
          {
            "node": "Extract data from file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine query result and chat answer": {
      "main": [
        [
          {
            "node": "Prepare final output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}