YouTube to Telegram, instant summaries you can reuse
You find a great YouTube video, you know it should turn into content, and then you hit the same wall. Transcript sites, messy copy-paste, missing sections, and a doc full of text you still need to “do something with.”
This YouTube summary bot hits marketers hardest, but educators and creators feel it too. You will go from “link in chat” to a clean summary you can reuse, plus follow-up prompts that reshape it into posts without starting over.
Below, you’ll see exactly what the n8n workflow does, what you need to run it, and how the moving parts fit together.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: YouTube to Telegram, instant summaries you can reuse
flowchart LR
subgraph sg0["Trigger: Telegram Bot Message Flow"]
direction LR
n0@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory", pos: "b", h: 48 }
n1@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Trigger: Telegram Bot Message"]
n3@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check: Is YouTube Link?", pos: "b", h: 48 }
n4@{ icon: "mdi:swap-vertical", form: "rounded", label: "Extract Chat & Video ID", pos: "b", h: 48 }
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Fetch YouTube Transcript (vi.."]
n6@{ icon: "mdi:swap-vertical", form: "rounded", label: "Clean Transcript Symbols", pos: "b", h: 48 }
n7@{ icon: "mdi:robot", form: "rounded", label: "AI Chat & Summarizer Agent", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Clean AI Output Formatting"]
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send Reply to Telegram"]
n0 -.-> n7
n1 -.-> n7
n3 --> n4
n3 --> n7
n4 --> n5
n6 --> n7
n7 --> n8
n8 --> n9
n2 --> n3
n5 --> n6
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n2 trigger
class n7 ai
class n1 aiModel
class n0 ai
class n3 decision
class n5 api
class n8 code
classDef customIcon fill:none,stroke:none
class n2,n5,n8,n9 customIcon
Why This Matters: Turning Videos Into Reusable Content Is Tedious
Content repurposing sounds easy until you actually do it. You watch a 20-minute video, grab a transcript, then spend the next chunk of your day cleaning speaker labels, removing weird timestamps, and hunting for the two parts you really wanted. Then comes the rewriting: a summary for your notes, a LinkedIn post with a hook, maybe a tweet thread. It’s not hard work, but it’s fragile. One bad copy-paste or a missing paragraph and you end up publishing something inaccurate or bland, which honestly is worse than publishing nothing.
The friction compounds. Here’s where it usually breaks down.
- Transcript exports often come through cluttered, which means you waste time cleaning before you can even start writing.
- If you’re doing this for a team, everyone summarizes differently and you get inconsistent “voice” across channels.
- Follow-up edits (“make it shorter,” “turn into bullets”) turn into a fresh prompt every time, so context gets lost.
- Manual workflows invite small errors that show up later as wrong quotes, wrong takeaways, or weak claims.
What You’ll Build: A Telegram Bot That Summarizes YouTube Links
This workflow gives you a simple habit: drop a YouTube link into Telegram and get a clean, reusable summary back. n8n listens for incoming Telegram messages, checks if the message is a real YouTube URL, and then extracts the video ID plus the user’s chat ID. If it’s a link, the workflow pulls the transcript via RapidAPI, sanitizes the text to remove odd characters, and passes the cleaned transcript into an AI Agent powered by an OpenAI chat model. The AI produces a summary and can also handle follow-ups like “make it shorter” or “turn this into a LinkedIn post,” using memory so the bot remembers what you’re talking about. If it’s not a link, it behaves like a normal AI chatbot inside Telegram, still with per-user memory.
The workflow starts with a Telegram message and a quick URL validation. From there, it either fetches and cleans a transcript or jumps straight into conversation mode. Finally, it formats the AI output so it reads nicely in Telegram, then sends the reply back to the same chat.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you repurpose 5 YouTube videos a week. Manually, it’s often about 10 minutes to find a transcript, about 10 minutes to clean it, then another 10 minutes to get a first summary you can actually use. That’s roughly 2 to 3 hours weekly, before you’ve written a single post. With this workflow: you paste a link into Telegram (maybe 30 seconds), wait a minute or two for the transcript and AI reply, then ask follow-ups like “make it a LinkedIn post.” You still edit, but the grunt work is basically gone.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Telegram for the bot interface and messages.
- RapidAPI to fetch YouTube transcripts.
- OpenAI API Key (get it from https://platform.openai.com/account/api-keys)
Skill level: Beginner. You’ll mostly paste API keys, connect Telegram, and tweak one AI prompt.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A Telegram message triggers the workflow. The bot listens for new messages, then passes the text along for validation so random chats don’t waste API calls.
The workflow checks if it’s a YouTube link. If the message matches a YouTube URL, n8n extracts the chat_id (so replies go to the right person) and pulls out the video ID used to fetch the transcript.
Transcript retrieval and cleanup happen automatically. n8n calls the transcript endpoint through RapidAPI using an HTTP Request node, then sanitizes the transcript text so the AI receives clean input instead of symbols and formatting junk.
An AI Agent generates the summary and handles follow-ups. OpenAI produces the initial summary, and the memory buffer keeps the conversation per user, so “make it shorter” actually refers to the same video summary you just got.
The reply is formatted and sent back to Telegram. A small formatting step makes the text readable in chat, then the workflow dispatches it as a Telegram message.
You can easily modify the AI output format to match your brand voice or preferred templates based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
This workflow starts when a user sends a Telegram message containing a YouTube URL.
- Add the Telegram Message Trigger node and keep Updates set to
message. - Credential Required: Connect your
telegramApicredentials in Telegram Message Trigger. - Click Listen for Test Event after saving the workflow to verify Telegram is connected.
Step 2: Validate and Route Incoming Messages
Validate the incoming message to ensure it contains a YouTube link and route accordingly.
- In Validate YouTube URL, set the condition String Contains with Left Value
{{$json.message.text}}and Right Valuehttps. - Connect Telegram Message Trigger → Validate YouTube URL.
- Use the true output to connect to Derive Chat and Video ID and the false output to connect to Chat and Summary Agent.
Step 3: Extract YouTube IDs and Retrieve Transcript
Parse the video ID and fetch the transcript from the RapidAPI endpoint.
- In Derive Chat and Video ID, set videoId to
{{$json["message"]["text"].match(/(?:v=|youtu\.be\/)([a-zA-Z0-9_-]+)/)[1]}}. - In the same node, set chatId to
{{$json["message"]["chat"]["id"]}}. - In Retrieve YouTube Transcript, set URL to
=https://youtube-transcript3.p.rapidapi.com/api/transcript?videoId={{ $json.videoId }}. - Enable Send Headers and set headers: X-RapidAPI-Key to
[CONFIGURE_YOUR_API_KEY]and X-RapidAPI-Host to[YOUR_ID]. - Connect Derive Chat and Video ID → Retrieve YouTube Transcript.
Step 4: Sanitize Transcript and Configure AI
Prepare the transcript text and configure the AI model and memory for contextual replies and summaries.
- In Sanitize Transcript Text, set fullTranscript to
{{ $json.transcript .map(item => item.text) .join(" ") .replace(/'/g, "'") .replace(/"/g, '"') .replace(/&/g, '&') }}. - Connect Retrieve YouTube Transcript → Sanitize Transcript Text → Chat and Summary Agent.
- In Chat and Summary Agent, set Text to
{{$json.message?.text ? $json.message.text : $json.fullTranscript}}and keep Prompt Type asdefine. - Verify the System Message instructs the agent to summarize videos and keep conversation context (already configured).
- Ensure OpenAI Dialogue Model is connected as the language model for Chat and Summary Agent. Credential Required: Connect your
openAiApicredentials in OpenAI Dialogue Model. - Confirm Conversation Memory Buffer is connected as memory for Chat and Summary Agent, with Session Key set to
{{ $('Validate YouTube URL').item.json.message.chat.id }}and Context Window Length set to10. Add any required credentials on the parent node (Chat and Summary Agent), not the sub-node.
Step 5: Format and Dispatch the Telegram Response
Clean the AI output and send it back to the user in Telegram.
- In Format AI Response, keep the JavaScript Code as provided to normalize markdown and spacing.
- Connect Chat and Summary Agent → Format AI Response → Dispatch Telegram Reply.
- In Dispatch Telegram Reply, set Text to
{{$json.cleanedMessage}}. - Set Chat ID to
{{ $('Telegram Message Trigger').item.json.message.chat.id }}and keep Parse Mode asMarkdown. - Credential Required: Connect your
telegramApicredentials in Dispatch Telegram Reply.
Step 6: Test and Activate Your Workflow
Validate the full flow from Telegram input to AI response and summary output.
- Click Execute Workflow, then send a Telegram message with a YouTube URL to the bot.
- Confirm that Validate YouTube URL routes correctly and Retrieve YouTube Transcript returns data.
- Verify the final response is returned by Dispatch Telegram Reply and formatted cleanly.
- When successful, toggle the workflow to Active so it runs continuously.
Troubleshooting Tips
- Telegram credentials can fail if the bot token is wrong or rotated. If replies stop, check the Telegram Trigger node token first, then confirm the bot still exists in @BotFather.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Quick Answers
About 30 minutes if you already have your API keys.
No. You’ll connect Telegram, RapidAPI, and OpenAI, then paste in credentials and test a message.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage plus RapidAPI transcript costs (varies by your plan, but it’s usually small for light weekly use).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and it’s the whole point. You’ll mainly edit the “Chat and Summary Agent” instructions to change the output (bullet summary, TL;DR, blog outline, lesson plan), and you can adjust the “Format AI Response” step to enforce a consistent template. If you don’t like RapidAPI, you can swap the “Retrieve YouTube Transcript” HTTP step for a different transcript provider as long as it returns text. Teams also add a command switch so “/linkedin” and “/thread” force a specific format every time.
Usually it’s a bad or expired bot token. Recheck the token in the Telegram Trigger node, confirm the bot is active in @BotFather, and make sure you’re messaging the correct bot (people often test with the wrong chat). If it still fails, look at the last execution log in n8n to see if Telegram is rejecting the request due to permissions or a malformed reply payload.
A typical setup can handle dozens of requests per day without drama, and self-hosted n8n can go higher if your server is sized appropriately.
It depends on how “chatty” you want the experience to be. n8n shines here because you can combine link detection, branching logic, transcript fetching, and an AI Agent with memory in one workflow, without turning it into a pile of separate zaps and paid tasks. Self-hosting also matters if you plan to run this frequently and don’t want per-execution pricing to creep up. Zapier and Make can be simpler for basic “YouTube link in → summary out” flows, but memory and follow-ups get awkward fast. If you’re unsure, Talk to an automation expert and you’ll get a straight recommendation.
This is the kind of automation you set up once and then rely on every week. The workflow handles the repetitive parts so your attention goes into publishing, teaching, or selling.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.