{
  "name": "Multi-user Telegram bot to summarize & repurpose YouTube videos with GPT-4o",
  "nodes": [
    {
      "id": "bd3d13e0-2b23-46d8-ab56-518184f4c23c",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        140,
        500
      ]
    },
    {
      "id": "d22d84d9-2b00-4593-9924-1684ee026fbb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -260
      ],
      "parameters": {
        "width": 800,
        "height": 440,
        "content": "## 🔗 YouTube Link Handling Flow\nThis section runs when the input message contains a YouTube link. It:\n\n- Extracts the video ID\n- Fetches transcript via RapidAPI\n- Cleans the raw transcript\n- Sends it "
      }
    },
    {
      "id": "1eca3b2c-0b1a-424a-b8c2-d14189818f77",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        180
      ],
      "parameters": {
        "width": 800,
        "height": 700,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 💬 AI Chatbot + Summarizer\nThis section handles both normal chat queries and summarized transcript processing. It:\n\n- Communicates with OpenAI to generate respon"
      }
    },
    {
      "id": "b2d752d1-ac81-4a82-a8e9-e4a88ac97cb0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        -260
      ],
      "parameters": {
        "width": 480,
        "height": 380,
        "content": "## 🔐 Required API Keys & Setup\n\n- **Telegram Bot Token**  \n  Get your bot token from [@BotFather](https://t.me/BotFather)\n\n- **OpenAI API Key**  \n  Generate your key from: https://platform.openai.com/"
      }
    },
    {
      "id": "9cdbf9d1-7487-4c56-8f56-c266cc30da3e",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -40,
        500
      ]
    },
    {
      "id": "656df439-1202-45c1-8cab-50835fc8a530",
      "name": "Trigger: Telegram Bot Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -580,
        160
      ]
    },
    {
      "id": "7e9b5742-db7b-4fbb-9f46-84ec64640e8e",
      "name": "Check: Is YouTube Link?",
      "type": "n8n-nodes-base.if",
      "position": [
        -340,
        160
      ]
    },
    {
      "id": "05b27964-d268-46d0-bb08-67650a5a08a7",
      "name": "Extract Chat & Video ID",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "6ec62300-e1b0-44ee-b02e-dd311b3ba0fb",
      "name": "Fetch YouTube Transcript (via RapidAPI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ]
    },
    {
      "id": "43eff5c7-3510-489f-86c1-a6d4eddb02d8",
      "name": "Clean Transcript Symbols",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        0
      ]
    },
    {
      "id": "9a98d935-bee8-4f40-99fb-d27362c3292f",
      "name": "AI Chat & Summarizer Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        0,
        280
      ]
    },
    {
      "id": "64cdc4a6-a746-4bb6-a564-620ada0a3e8f",
      "name": "Clean AI Output Formatting",
      "type": "n8n-nodes-base.code",
      "position": [
        320,
        280
      ]
    },
    {
      "id": "a77693f4-387c-436f-805c-35cf577aae4b",
      "name": "Send Reply to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        500,
        280
      ]
    },
    {
      "id": "0016fa99-cf96-4aae-8aef-d817a7841195",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        280
      ],
      "parameters": {
        "width": 480,
        "height": 580,
        "content": "## 🧠 Workflow Logic Overview\n\n- **Triggers** on any Telegram message.\n- **Checks** if the message contains a YouTube link:\n\n  ### If yes:\n  - Extracts video ID  \n  - Fetches transcript via **RapidAPI*"
      }
    }
  ],
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Chat & Summarizer Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Chat & Summarizer Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check: Is YouTube Link?": {
      "main": [
        [
          {
            "node": "Extract Chat & Video ID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Chat & Summarizer Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Chat & Video ID": {
      "main": [
        [
          {
            "node": "Fetch YouTube Transcript (via RapidAPI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Transcript Symbols": {
      "main": [
        [
          {
            "node": "AI Chat & Summarizer Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Chat & Summarizer Agent": {
      "main": [
        [
          {
            "node": "Clean AI Output Formatting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean AI Output Formatting": {
      "main": [
        [
          {
            "node": "Send Reply to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: Telegram Bot Message": {
      "main": [
        [
          {
            "node": "Check: Is YouTube Link?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch YouTube Transcript (via RapidAPI)": {
      "main": [
        [
          {
            "node": "Clean Transcript Symbols",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}