{
  "name": "🗼 AI powered supply chain control tower with BigQuery and GPT-4o",
  "nodes": [
    {
      "id": "53b36910-966f-45ba-a425-a3260a55059f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        340,
        480
      ]
    },
    {
      "id": "177235e8-c925-43d0-9695-10f072e26350",
      "name": "AI Control Tower Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        380,
        240
      ]
    },
    {
      "id": "5366cc5f-85d3-44d2-9b1b-62febfcb44e3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        -120
      ],
      "parameters": {
        "width": 200,
        "height": 520,
        "content": "### 1. Workflow Trigger with Chat\nThis workflow uses a simple chat window as a trigger. You can replace it with Telegram, Slack, Teams or a webhook trigger linked to your chat.\n\n#### How to setup?\n*No"
      }
    },
    {
      "id": "4218a062-12f8-437d-ab22-5a653a3089b2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -120
      ],
      "parameters": {
        "width": 700,
        "height": 740,
        "content": "### 2. AI Agent equipped with the query tool\nIn order to have more control on the input of the BigQuery node, we don't use the BigQuery tool. Instead we have a set of nodes to retrieve the SQL query, "
      }
    },
    {
      "id": "c5967f58-00e8-4f03-9110-913547f7ab9c",
      "name": "Call Query Tool",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        640,
        440
      ]
    },
    {
      "id": "429813c8-b07f-4551-aeea-1744a1225449",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        -120
      ],
      "parameters": {
        "width": 760,
        "height": 460,
        "content": "### 3. Big Query Workflow\nExecute the SQL query generated by the AI agent in Big Query. Retrieve the results and send them back to the AI Agent.\n\n### How to set up?\n- Paste these nodes in a separate w"
      }
    },
    {
      "id": "bede0624-8923-4af0-8adc-8be22d556066",
      "name": "Query Database",
      "type": "n8n-nodes-base.googleBigQuery",
      "position": [
        1520,
        180
      ]
    },
    {
      "id": "137e4dbc-db8d-4ec7-a3e0-478dde6ef27c",
      "name": "Trigger Executed by the AI Tool",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        960,
        180
      ]
    },
    {
      "id": "42a2801e-582e-4340-83af-ef0041eab4f9",
      "name": "Sanitising the Query",
      "type": "n8n-nodes-base.code",
      "position": [
        1240,
        180
      ]
    },
    {
      "id": "7c86fda0-116c-47ad-aaf5-8b83d2c083c6",
      "name": "Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        480,
        480
      ]
    },
    {
      "id": "e1408ac1-24da-4d38-8fdf-c110a54d3f55",
      "name": "Chat with the User",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -60,
        240
      ]
    },
    {
      "id": "bc49829b-45f2-4910-9c37-907271982f14",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        380
      ],
      "parameters": {
        "width": 780,
        "height": 540,
        "content": "### 4. Do you need more details?\nFind a step-by-step guide in this tutorial\n![Guide](https://www.samirsaci.com/content/images/2025/04/image.png)\n[🎥 Watch My Tutorial](https://www.loom.com/share/50271f"
      }
    }
  ],
  "connections": {
    "Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Control Tower Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Call Query Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Control Tower Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Control Tower Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Chat with the User": {
      "main": [
        [
          {
            "node": "AI Control Tower Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sanitising the Query": {
      "main": [
        [
          {
            "node": "Query Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Executed by the AI Tool": {
      "main": [
        [
          {
            "node": "Sanitising the Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}