{
  "name": "Create an AI-powered Telegram customer support bot with lead management",
  "nodes": [
    {
      "id": "71b9a677-06e0-42e3-aa8f-578e6247a382",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2208,
        656
      ]
    },
    {
      "id": "5136fc3a-6577-4441-ad57-fcc5b0cea2d1",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2432,
        656
      ]
    },
    {
      "id": "189a1715-dc89-4d39-ae62-d6f80d9ee11d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -224
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "3b6dd5eb-8837-4f95-89c8-549743f8def0",
      "name": "Telegram - Incoming Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        176,
        32
      ]
    },
    {
      "id": "daf6ca06-da61-4ace-a33c-706453e1e0eb",
      "name": "Log - User Message",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        576,
        32
      ]
    },
    {
      "id": "37a85b98-ad4d-4d64-9836-217313851e48",
      "name": "Log - Bot Message",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3536,
        48
      ]
    },
    {
      "id": "8c821185-dd04-4282-aa6d-7867dad10925",
      "name": "DB - Get Lead by User ID",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        912,
        32
      ]
    },
    {
      "id": "c340ee82-44f7-4e05-a16f-8b48a1601144",
      "name": "DB - Create Lead",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1504,
        176
      ]
    },
    {
      "id": "c8c81aea-6385-4389-ac8c-1a934d7dcef1",
      "name": "DB - Update Lead",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        2624,
        656
      ]
    },
    {
      "id": "6c98a92e-1cfb-4505-ac62-8046a37e0961",
      "name": "AI - Smart Support Assistant",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2512,
        32
      ]
    },
    {
      "id": "4d0d1528-2c4f-45de-ac2e-f699a3a75abd",
      "name": "DB - Get FAQ",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        2816,
        656
      ]
    },
    {
      "id": "c757970a-3e13-4f4f-b8b2-325b2aa45d16",
      "name": "DB - Get Services",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        3008,
        656
      ]
    },
    {
      "id": "3076d9aa-0a6c-40dc-9334-f622ed3b2a5e",
      "name": "DB - Get Settings",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        3216,
        656
      ]
    },
    {
      "id": "54170bbc-6047-4939-bd57-9afae970e3ac",
      "name": "Telegram - Send Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3936,
        48
      ]
    },
    {
      "id": "88ed32c8-977f-4cd5-a2f8-11d6aca1c264",
      "name": "Build Assistant Context",
      "type": "n8n-nodes-base.code",
      "position": [
        1856,
        32
      ]
    },
    {
      "id": "07268ffc-f684-439c-9a93-bc67358a25bf",
      "name": "Check – Lead Record",
      "type": "n8n-nodes-base.if",
      "position": [
        1168,
        32
      ]
    },
    {
      "id": "5103c661-3efa-4f1f-af92-6d8c77353406",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -176
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c94e776e-463f-431c-8aaf-f38a082413c8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -112
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f148c107-9abd-4b44-853b-bf285bf31caa",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        -144
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0f98316e-2b53-4d2e-9e9b-7af3c5c235c1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3472,
        -112
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b049cb8c-13b3-452a-a775-5aeebdbcc72d",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -128
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "5dc04310-c03e-4a47-a6f5-a236c8e64833",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        -144
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "4119ca42-0805-4120-b665-4757174a2d11",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3856,
        -112
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "DB - Get FAQ": {
      "ai_tool": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "DB - Create Lead": {
      "main": [
        [
          {
            "node": "Build Assistant Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Update Lead": {
      "ai_tool": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DB - Get Services": {
      "ai_tool": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DB - Get Settings": {
      "ai_tool": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Log - Bot Message": {
      "main": [
        [
          {
            "node": "Telegram - Send Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log - User Message": {
      "main": [
        [
          {
            "node": "DB - Get Lead by User ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check – Lead Record": {
      "main": [
        [
          {
            "node": "Build Assistant Context",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DB - Create Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Build Assistant Context": {
      "main": [
        [
          {
            "node": "AI - Smart Support Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Get Lead by User ID": {
      "main": [
        [
          {
            "node": "Check – Lead Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - Incoming Message": {
      "main": [
        [
          {
            "node": "Log - User Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI - Smart Support Assistant": {
      "main": [
        [
          {
            "node": "Log - Bot Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}