{
  "name": "PostgreSQL conversational agent with Claude & DeepSeek (Multi-KPI, Secure)",
  "nodes": [
    {
      "id": "735a96e6-a254-4c0c-8268-88c33db886e8",
      "name": "GetTableSchema",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        -40,
        920
      ]
    },
    {
      "id": "aba773b1-8fd0-4b5a-953f-c2de44029b68",
      "name": "ListTables",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        60,
        1020
      ]
    },
    {
      "id": "217bac36-8448-4f91-b53f-2ffb8dcb13c1",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        760,
        880
      ]
    },
    {
      "id": "8752c39a-5bb6-4696-a591-cb7a4f649586",
      "name": "CreateTableRecords",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        180,
        1020
      ]
    },
    {
      "id": "448c74a8-8051-4aeb-be50-98f61b4c1476",
      "name": "ReadTableRecord",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        720
      ]
    },
    {
      "id": "a51c89a7-3c6e-4c71-83f7-c17dea2fac6a",
      "name": "Operation",
      "type": "n8n-nodes-base.switch",
      "position": [
        920,
        880
      ]
    },
    {
      "id": "0ee5c0cf-cb53-41a7-a81e-1eca93648eee",
      "name": "UpdateTableRecord",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        1040
      ]
    },
    {
      "id": "2f0fafb5-e369-4550-99df-04983c4f0080",
      "name": "UpdateTableRecords",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        300,
        1040
      ]
    },
    {
      "id": "40deab57-d6f3-4f40-8368-ae0b5c0830e7",
      "name": "CreateTableRecord",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        880
      ]
    },
    {
      "id": "e6d70398-2fda-4ad4-9fa9-9277b0e8037f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        500
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "13154e61-77a4-40bb-b2a1-49c43af5e8c8",
      "name": "PostgreSQL MCP Server",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        120,
        580
      ]
    },
    {
      "id": "62e57740-0e1c-46ce-8a12-d963dfe47d65",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        500
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "87fba2e8-96d1-48e1-bd2e-fefbf6d1ba74",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        300,
        1440
      ]
    },
    {
      "id": "19d4bfb8-ab2f-447f-8d58-4bfe2b7d182c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        540,
        1400
      ]
    },
    {
      "id": "87781b4a-1c07-4447-b28f-bc9010dfe672",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        540,
        1760
      ]
    },
    {
      "id": "3ff30556-c402-47d7-b0d4-200c61006cb9",
      "name": "MCP Client",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        700,
        1760
      ]
    },
    {
      "id": "a43e3dc5-adbf-4ae5-b46a-d04654cebbf0",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        360,
        1740
      ]
    },
    {
      "id": "b683d331-989f-4b09-8158-df302fe12cab",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1000,
        1720
      ]
    },
    {
      "id": "cf864de0-57a5-4537-b42c-5ad12da49d01",
      "name": "get table details",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        540,
        860
      ]
    },
    {
      "id": "01300da8-259d-43ca-9185-2f16cf7e2913",
      "name": "ReadTableRows",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        480,
        1020
      ]
    },
    {
      "id": "9bdb7802-23ad-45d2-a35e-1de546aa8903",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        1320
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        []
      ]
    },
    "Operation": {
      "main": [
        [
          {
            "node": "ReadTableRecord",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "CreateTableRecord",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "UpdateTableRecord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ListTables": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "ReadTableRows": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "GetTableSchema": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "ReadTableRecord": {
      "main": [
        []
      ]
    },
    "get table details": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "CreateTableRecords": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "UpdateTableRecords": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Operation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}