{
  "name": "Project: Telegram Chatbot",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -144,
        0
      ],
      "id": "3f8dc3b1-2608-41ac-a3f5-351e235c76aa",
      "name": "Telegram Trigger",
      "webhookId": "e44fceb9-1b8f-4957-9335-a794e7b82bdf",
      "credentials": {
        "telegramApi": {
          "id": "DA4UGj08LgRnRgDf",
          "name": "Catalin Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Telegram Trigger').item.json.message.text }}",
        "options": {
          "systemMessage": "You are a helpful assistant that tries to answer all user questions with humor and wit. But make it accurate. Use emojis and colorful language."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        360,
        0
      ],
      "id": "38cfcdeb-69a7-4ab5-bf3e-b1cd848bdecb",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        304,
        224
      ],
      "id": "b9044b4b-ac6e-4390-a961-3dc052e8164d",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "xHWDVrLvQFklSodD",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $execution.id }}",
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        432,
        224
      ],
      "id": "adba3b59-2f7c-4bda-8dc4-293f5e7b0102",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        768,
        0
      ],
      "id": "dcbb7b92-cff2-4f24-9e40-30d85a5d771a",
      "name": "Send a text message",
      "webhookId": "69fc91e1-4bb4-405a-9bd9-3970569f0f5b",
      "credentials": {
        "telegramApi": {
          "id": "DA4UGj08LgRnRgDf",
          "name": "Catalin Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendChatAction",
        "chatId": "={{ $json.message.chat.id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        80,
        0
      ],
      "id": "25b5fd42-01db-4bfa-af2d-99e6e9658d09",
      "name": "Send a chat action",
      "webhookId": "02bf17df-3a22-4a67-9734-c49315665ed5",
      "credentials": {
        "telegramApi": {
          "id": "DA4UGj08LgRnRgDf",
          "name": "Catalin Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "typeVersion": 1,
      "position": [
        560,
        224
      ],
      "id": "bb895fcc-142a-4ead-a86c-566996d94c72",
      "name": "SerpAPI",
      "credentials": {
        "serpApi": {
          "id": "kxp6QU3D80FDq3Ga",
          "name": "SerpAPI account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Send a chat action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a chat action": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "876ef6f7-f3c8-42d3-a5d1-cb6f3fc8fc9d",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "281c34c03b9c41f054c536eeb966e9e503918cf7f00e3bc32a5ff9cca85ca255"
  },
  "id": "PYR5YiB0WxuLtZJM",
  "tags": []
}