This workflow corresponds to n8n.io template #5468 — we link there as the canonical source.
This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "WhaOZtqmJ5c3XITs",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "multi-user-yt-summarizer-telegram-bot",
"tags": [
{
"id": "SMT2ut5VYVrJOgut",
"name": "youtube",
"createdAt": "2025-06-30T08:40:55.235Z",
"updatedAt": "2025-06-30T08:40:55.235Z"
},
{
"id": "hph9VLUPCMHpsvSv",
"name": "openai",
"createdAt": "2025-06-30T08:39:10.366Z",
"updatedAt": "2025-06-30T08:39:10.366Z"
},
{
"id": "tUeZKzt938bXg8LF",
"name": "telegram",
"createdAt": "2025-06-30T08:41:15.614Z",
"updatedAt": "2025-06-30T08:41:15.614Z"
},
{
"id": "F5VpnJWM04Me0ZD2",
"name": "chatbot",
"createdAt": "2025-06-30T08:41:22.379Z",
"updatedAt": "2025-06-30T08:41:22.379Z"
},
{
"id": "uABH3QyIGSUmT7AF",
"name": "rapidapi",
"createdAt": "2025-06-30T08:41:26.545Z",
"updatedAt": "2025-06-30T08:41:26.545Z"
},
{
"id": "egtP0LfV8KaAj1YV",
"name": "multiuser",
"createdAt": "2025-06-30T08:41:33.986Z",
"updatedAt": "2025-06-30T08:41:33.986Z"
},
{
"id": "X8lvHiSMCOg8UP1u",
"name": "transcriptor",
"createdAt": "2025-06-30T08:41:42.229Z",
"updatedAt": "2025-06-30T08:41:42.229Z"
}
],
"nodes": [
{
"id": "bd3d13e0-2b23-46d8-ab56-518184f4c23c",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
140,
500
],
"parameters": {
"sessionKey": "={{ $('Check: Is YouTube Link?').item.json.message.chat.id }}",
"sessionIdType": "customKey",
"contextWindowLength": 10
},
"typeVersion": 1.3
},
{
"id": "d22d84d9-2b00-4593-9924-1684ee026fbb",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-120,
-260
],
"parameters": {
"color": 3,
"width": 800,
"height": 440,
"content": "## \ud83d\udd17 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 to OpenAI for summarization\n- The response is then forwarded to the AI chat agent."
},
"typeVersion": 1
},
{
"id": "1eca3b2c-0b1a-424a-b8c2-d14189818f77",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-120,
180
],
"parameters": {
"color": 5,
"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## \ud83d\udcac AI Chatbot + Summarizer\nThis section handles both normal chat queries and summarized transcript processing. It:\n\n- Communicates with OpenAI to generate responses\n- Stores context for follow-ups\n- Cleans formatting (like bold syntax **)\n- Sends clean output back to Telegram"
},
"typeVersion": 1
},
{
"id": "b2d752d1-ac81-4a82-a8e9-e4a88ac97cb0",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1200,
-260
],
"parameters": {
"color": 7,
"width": 480,
"height": 380,
"content": "## \ud83d\udd10 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/account/api-keys\n\n- You can also use **Groq API** as a free alternative to OpenAI: https://console.groq.com\n\n- **RapidAPI Credentials** *(used in the HTTP Request Node)*:\n - `X-RapidAPI-Key`: Your personal RapidAPI key \n - `X-RapidAPI-Host`: Typically `youtube-transcript3.p.rapidapi.com` or similar\n"
},
"typeVersion": 1
},
{
"id": "9cdbf9d1-7487-4c56-8f56-c266cc30da3e",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-40,
500
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "656df439-1202-45c1-8cab-50835fc8a530",
"name": "Trigger: Telegram Bot Message",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-580,
160
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "7e9b5742-db7b-4fbb-9f46-84ec64640e8e",
"name": "Check: Is YouTube Link?",
"type": "n8n-nodes-base.if",
"position": [
-340,
160
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9177ca8c-fa10-4d34-a080-eeddeeec3319",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.message.text }}",
"rightValue": "https"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "05b27964-d268-46d0-bb08-67650a5a08a7",
"name": "Extract Chat & Video ID",
"type": "n8n-nodes-base.set",
"position": [
0,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "9df2601d-3f98-4152-9973-8f1e59585fba",
"name": "videoId",
"type": "string",
"value": "={{ $json[\"message\"][\"text\"].match(/(?:v=|youtu\\.be\\/)([a-zA-Z0-9_-]+)/)[1] }}\n"
},
{
"id": "6b989928-41d0-4913-8f4b-e951a8fa9136",
"name": "chatId",
"type": "string",
"value": "={{ $json[\"message\"][\"chat\"][\"id\"] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "6ec62300-e1b0-44ee-b02e-dd311b3ba0fb",
"name": "Fetch YouTube Transcript (via RapidAPI)",
"type": "n8n-nodes-base.httpRequest",
"position": [
220,
0
],
"parameters": {
"url": "=https://youtube-transcript3.p.rapidapi.com/api/transcript?videoId={{ $json.videoId }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "X-RapidAPI-Key",
"value": "YOUR_RAPIDAPI_KEY_HERE"
},
{
"name": "X-RapidAPI-Host",
"value": "YOUR_RAPIDAPI_HOST_HERE"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "43eff5c7-3510-489f-86c1-a6d4eddb02d8",
"name": "Clean Transcript Symbols",
"type": "n8n-nodes-base.set",
"position": [
440,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "74c4d613-8154-41e2-90b5-0e837de83a69",
"name": "fullTranscript",
"type": "string",
"value": "={{ \n $json.transcript\n .map(item => item.text)\n .join(\" \")\n .replace(/'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/&/g, '&')\n}}\n"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "9a98d935-bee8-4f40-99fb-d27362c3292f",
"name": "AI Chat & Summarizer Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
0,
280
],
"parameters": {
"text": "={{ $json.message?.text ? $json.message.text : $json.fullTranscript }}",
"options": {
"systemMessage": "You are an assistant who chats with users and also summarizes YouTube videos when requested.\n\nIMPORTANT:\n1)Dont force the user to provide provide the transcript or youtube video link.\n\n\nIf the user sends a YouTube link and asks for a summary, generate a concise summary of that video.\n\nOtherwise, reply normally and help with any other requests.\nKeep the conversation context.\nIf the user requests modifications to a previous summary, adjust the existing summary rather than starting from scratch"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "64cdc4a6-a746-4bb6-a564-620ada0a3e8f",
"name": "Clean AI Output Formatting",
"type": "n8n-nodes-base.code",
"position": [
320,
280
],
"parameters": {
"jsCode": "const raw = $json[\"output\"];\n\n// Step 1: Clean and format the structure\nlet cleaned = raw\n .replace(/\\*\\*/g, '') // Remove bold markers\n .replace(/\\\\n/g, '\\n') // Replace literal \\n with real newlines\n .replace(/\\* /g, '- ') // Convert bullets from * to -\n .replace(/\\*/g, '') // Remove stray asterisks\n .replace(/_/g, '') // Remove underscores\n .replace(/`/g, '') // Remove backticks\n .replace(/>/g, '') // Remove blockquote symbols\n .replace(/#/g, ''); // Remove markdown headers\n\n// Step 2: Normalize spacing and extra newlines\ncleaned = cleaned\n .replace(/\\n{3,}/g, '\\n\\n') // Collapse 3+ newlines to 2\n .replace(/[ ]{2,}/g, ' ') // Collapse multiple spaces\n .trim();\n\nreturn [{\n cleanedMessage: cleaned\n}];\n"
},
"typeVersion": 2
},
{
"id": "a77693f4-387c-436f-805c-35cf577aae4b",
"name": "Send Reply to Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
500,
280
],
"parameters": {
"text": "={{ $json.cleanedMessage }}",
"chatId": "={{ $('Trigger: Telegram Bot Message').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "0016fa99-cf96-4aae-8aef-d817a7841195",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1200,
280
],
"parameters": {
"color": 7,
"width": 480,
"height": 580,
"content": "## \ud83e\udde0 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** \n - Cleans the transcript (replaces symbols like `'` with `'`) \n - Sends the clean transcript to **OpenAI** for summarization \n\n ### If no:\n - Treats it as a normal chat message \n - Sends message directly to **OpenAI** \n\n- **OpenAI** responds with either a summary or chat reply \n- **Output is cleaned** (removes unsupported symbols like `**`) \n- Final reply is **sent back to the user** via Telegram\n\n\u2705 Also supports **follow-up commands** like:\n- \u201cMake it shorter\u201d \n- \u201cTurn this into a LinkedIn post\u201d \n- \u201cCreate a tweet thread\u201d\n- And more."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "42e4d264-16f6-47c2-a0eb-ae29c0749b00",
"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
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow is for content creators, marketers, educators, or anyone who wants to instantly summarize YouTube videos and repurpose them into different formats (LinkedIn post, tweet, etc.) via a simple Telegram chatbot.
Source: https://n8n.io/workflows/5468/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Digital marketers, content creators, social media managers, and businesses who want to use AI marketing automation for YouTube Shorts without spending hours on production. This AI workflow helps anyon
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.
Template Carnaval - time instagram. Uses toolWorkflow, lmChatOpenAi, memoryBufferWindow, agent. Event-driven trigger; 56 nodes.
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
Multi-modal AI Image Generator powered by Google's Nano Banana (Gemini 2.5 Flash Image)* - the latest state-of-the-art image generation model Accepts text, images, voice messages, and PDFs via Telegra