{
  "name": "Chat with GPT-5 on Telegram: AI-powered conversational bot",
  "nodes": [
    {
      "id": "368c3442-b61b-4e35-9de0-f7ef3f52aa0f",
      "name": "📩 Receive Telegram Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        1072,
        1968
      ]
    },
    {
      "id": "fe8f2304-f2f6-45d5-8f26-3e07f59f2122",
      "name": "Sticky Note — Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        304
      ],
      "parameters": {
        "width": 560,
        "height": 496,
        "content": "# 💬 AI Chat Bot — Telegram + AIMLAPI (via n8n)\n\nThis workflow lets users chat with **GPT-5** directly in Telegram. Messages are processed and answered in real-time via **AIMLAPI**.\n\n---\n\n## 🚀 Features"
      }
    },
    {
      "id": "1d3c2472-92fe-4d4e-b157-81de61882d0b",
      "name": "Sticky Note — Customization",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        816
      ],
      "parameters": {
        "width": 560,
        "height": 560,
        "content": "## ⚙️ Customization\n\n* Change the `model` parameter to use other AI models (Claude, Gemini, etc.)\n* Add:\n  * Message logging to Google Sheets or DB\n  * NSFW filtering\n  * Command handling (`/help`, `/"
      }
    },
    {
      "id": "fc3443dd-7c1d-478f-846b-e20b2d480898",
      "name": "Sticky Note — Setup Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        448
      ],
      "parameters": {
        "width": 560,
        "height": 544,
        "content": "# 🛠 Setup Guide\n\n### 1. 📲 Create a Telegram Bot\n* Go to [@BotFather](https://t.me/BotFather)\n* Use `/newbot`, set a name and username\n* Save the **API token**\n\n---\n### 2. 🔐 Connect Telegram API in n8n"
      }
    },
    {
      "id": "cdd88b85-4766-4e2c-9e5f-7b409963c443",
      "name": "Sticky Note — Logging & Testing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        1008
      ],
      "parameters": {
        "width": 560,
        "height": 432,
        "content": "## 📁 Optional Data Logging\n\nYou can log every chat message to Google Sheets or a database for analytics:\n\n` | user_id | date | message | response | `\n` | ------- | ---- | ------- | -------- | `\n\n---\n#"
      }
    },
    {
      "id": "f6b40a2d-c83a-47aa-9046-23cdc601ef73",
      "name": "📝 Log Successful Generation",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2784,
        1968
      ]
    },
    {
      "id": "a00ee4eb-0c89-48a2-87c1-000197b71a55",
      "name": "Sticky Note — Receive Message",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        1552
      ],
      "parameters": {
        "width": 384,
        "height": 608,
        "content": "# 📥 Step 1 — Receive Telegram Message\nListens for new messages sent to your Telegram bot.\n\nCaptures:\n* **chat.id** — used for sending responses back\n* **message.text** — the text provided by the user\n"
      }
    },
    {
      "id": "375019d6-a2c0-438c-950c-376603599dc5",
      "name": "Sticky Note — GPT‑5 Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        1552
      ],
      "parameters": {
        "width": 384,
        "height": 608,
        "content": "# 🧠 Step 2 — Process with GPT‑5\nSends the raw Telegram message text to **AI/ML API** using `openai/gpt-5-chat-latest`.\n\nPurpose:\n* Improve or expand the input text\n* Make it more descriptive/structure"
      }
    },
    {
      "id": "e58d2186-f12e-43a4-9b7c-a644d27e64fa",
      "name": "Sticky Note — Send Response",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        1552
      ],
      "parameters": {
        "width": 384,
        "height": 608,
        "content": "# 📤 Step 3 — Send Response to Telegram\nSends the model’s response back to the same user.\n\nIncludes:\n* **chat_id** — from the original message\n* **text/caption** — the result returned by GPT‑5\n\n💡 You c"
      }
    },
    {
      "id": "06a31bfb-15af-40fe-b468-057cf985180f",
      "name": "Sticky Note — Logging",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        1552
      ],
      "parameters": {
        "width": 384,
        "height": 608,
        "content": "# 📝 Step 4 — Log Interaction (Optional)\nAppends a row to your sheet/database with:\n* **date** — ISO date\n* **user_id** — from Telegram\n* **query** — original message text\n* **result** — model output ("
      }
    },
    {
      "id": "333a49e9-e553-4f95-87b9-d89548db6114",
      "name": "🧠 Process with GPT‑5",
      "type": "n8n-nodes-aimlapi.aimlApi",
      "position": [
        1888,
        1968
      ]
    },
    {
      "id": "960ea33b-3c1a-4ad1-a330-18aab8bc030a",
      "name": "📤 Send Response to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2288,
        1968
      ]
    },
    {
      "id": "7cc29371-2e04-440c-baea-4f7a716a5acf",
      "name": "Sticky Note — Receive Message1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        1552
      ],
      "parameters": {
        "width": 384,
        "height": 608,
        "content": "# 💬 Step 1.5 — Simulate Typing in Telegram\n\n\nSends a \"typing…\" chat action to the user in Telegram before delivering the actual \nresponse. \n\nThis creates a more natural conversational experience by le"
      }
    },
    {
      "id": "3e50eeda-e420-48fe-b136-1191d679f422",
      "name": "💬 Simulate Typing in Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1488,
        1968
      ]
    }
  ],
  "connections": {
    "🧠 Process with GPT‑5": {
      "main": [
        [
          {
            "node": "📤 Send Response to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📩 Receive Telegram Message": {
      "main": [
        [
          {
            "node": "💬 Simulate Typing in Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 Send Response to Telegram": {
      "main": [
        [
          {
            "node": "📝 Log Successful Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💬 Simulate Typing in Telegram": {
      "main": [
        [
          {
            "node": "🧠 Process with GPT‑5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}