{
  "name": "Conversational PostgreSQL agent with visuals, multi-KPI, and data editing (MCP)",
  "nodes": [
    {
      "id": "0c49141e-128c-424e-afdf-ea131b7a3dd8",
      "name": "GetTableSchema",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        -40,
        840
      ]
    },
    {
      "id": "8ffeefb9-357c-41bc-8239-0c07c706be97",
      "name": "ListTables",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        20,
        980
      ]
    },
    {
      "id": "efcf7ff3-976e-448a-9d47-47a98f3b0fcb",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        920,
        820
      ]
    },
    {
      "id": "abd292d7-fc2b-4e98-a474-b50e44d16b6c",
      "name": "CreateTableRecords",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        160,
        1020
      ]
    },
    {
      "id": "4a71d42a-99a5-489e-b449-09c3c5081505",
      "name": "ReadTableRecord",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1420,
        620
      ]
    },
    {
      "id": "bdc60aa8-9ab1-4bbd-8b9e-89c968d54043",
      "name": "Operation",
      "type": "n8n-nodes-base.switch",
      "position": [
        1120,
        820
      ]
    },
    {
      "id": "cdb5b556-3638-4fa5-94c6-bff0c03f6c89",
      "name": "UpdateTableRecord",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1420,
        1020
      ]
    },
    {
      "id": "9263fc78-321e-4c83-90d3-890dd87d6aed",
      "name": "UpdateTableRecords",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        320,
        1040
      ]
    },
    {
      "id": "dd7e28fb-b2c7-4084-bc9b-9aa3e0187682",
      "name": "CreateTableRecord",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1420,
        820
      ]
    },
    {
      "id": "9cf39ca3-b704-49ce-b6e2-db2703c4acad",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        540
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "ac3d9b98-8f1e-4abd-972c-1725aac1ad1e",
      "name": "PostgreSQL MCP Server",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        80,
        620
      ]
    },
    {
      "id": "416a09d5-c327-410d-b951-a2d08402c6fe",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        540
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c514c8a8-25b8-474b-8e3d-3a598e15c4ab",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        360,
        1260
      ]
    },
    {
      "id": "294589fe-2dc4-40ea-b4e4-d7c42d1a28e1",
      "name": "MCP Client",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        640,
        1560
      ]
    },
    {
      "id": "c566125c-daac-4b3f-ac2c-19588fd96831",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        340,
        1600
      ]
    },
    {
      "id": "ce46a834-c43c-4d14-b98c-c37084534324",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        840,
        1540
      ]
    },
    {
      "id": "2513b2d7-bcdd-4622-93a1-27608af78894",
      "name": "get table details",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        620,
        1040
      ]
    },
    {
      "id": "324503c0-117b-45ec-97dd-7074eb1db22e",
      "name": "ReadTableRows",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        480,
        1040
      ]
    },
    {
      "id": "39a88e5b-585e-4caa-8f4a-d7c313dce70e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        1220
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "87a1998e-0106-43c2-943f-7b9b6744fd7f",
      "name": "Plot tool",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        640,
        840
      ]
    },
    {
      "id": "ed260e47-5ba9-44fd-93b8-1643304da110",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        500,
        1600
      ]
    },
    {
      "id": "05a17841-b900-4e5c-bd46-1707892f4a82",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        1260
      ]
    }
  ],
  "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
          }
        ]
      ]
    },
    "Plot tool": {
      "ai_tool": [
        [
          {
            "node": "PostgreSQL MCP Server",
            "type": "ai_tool",
            "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
          }
        ]
      ]
    }
  }
}