Opening Problem Statement
Meet Susan, a content marketer who spends hours each week reviewing lengthy YouTube videos to extract valuable insights and share summaries with her team. Manually transcribing, summarizing, and distributing video content not only wastes time but also introduces errors and inconsistencies. Susan often finds herself overwhelmed, missing deadlines, and struggling to keep her team informed efficiently.
This is the exact challenge solved by our custom n8n workflow for YouTube transcript summarization. It automates intake of any YouTube video URL, transcribes the video, generates a structured summary, and then delivers these insights directly to a Telegram channel—all without manual intervention. This workflow saves Susan hours every week and ensures her team never misses key content updates.
What This Automation Does
When this workflow runs, here’s what happens step-by-step:
- Receives a YouTube video URL via a Webhook POST request.
- Extracts the video ID from the full URL using a Code node with JavaScript regex.
- Retrieves video metadata like title and description using the YouTube node.
- Fetches the full video transcript with the YouTube Transcript node.
- Splits the transcript into manageable parts for processing.
- Concatenates transcript pieces to create a single text block.
- Sends the full transcript text to a Langchain LLM node for generating a detailed structured summary respecting specific formatting rules.
- Constructs a response object including the summary, topics array (initially empty), and key video information.
- Responds to the original webhook request with this data and simultaneously sends a summary message to a Telegram channel for team notification.
This automation can easily save hours that would otherwise be spent on manual transcription, summarization, and sharing. It removes human error in summarizing and accelerates content repurposing strategies.
Prerequisites ⚙️
- n8n Automation Platform Account (cloud or self-hosted)
- YouTube API Access configured in n8n (for YouTube node usage)
- Telegram Bot API credentials configured for Telegram node ➡️ to send notifications
- Langchain OpenAI LLM Integration for transcript summarization
- Webhook exposure accessible to send POST requests with YouTube URLs
Step-by-Step Guide
Step 1: Create the Webhook Trigger
In n8n, click Add Node → select Webhook. Set HTTP Method to POST and path to ytube. This is the entry point for YouTube URLs.
Expected: When triggered by POST with JSON body containing { "youtubeUrl": "https://youtube.com/watch?v=..." }, it starts the workflow.
Common mistake: Forgetting to deploy or exposing the webhook URL publicly for external services.
Step 2: Extract YouTube URL from Webhook Data
Add a Set node named “Get YouTube URL”. Map $json.body.youtubeUrl to a new field called youtubeUrl.
This organizes incoming webhook data for the next steps.
Step 3: Extract YouTube Video ID Using Code Node
Add a Code node called “YouTube Video ID”. Paste this JavaScript code:
const extractYoutubeId = (url) => {
const pattern = /(?:youtube.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu.be/)([^"&?/s]{11})/;
const match = url.match(pattern);
return match ? match[1] : null;
};
const youtubeUrl = items[0].json.youtubeUrl;
return [{ json: { videoId: extractYoutubeId(youtubeUrl) } }];This extracts the unique 11-character YouTube video ID for API calls.
Common mistake: Using URLs without “https://” or malformed URLs causing regex to fail.
Step 4: Retrieve YouTube Video Metadata
Add the YouTube node, configure to get video information by passing {{ $json.videoId }} as input.
You should see details like title, description, and video ID returned. This builds context for the summary output.
Step 5: Fetch Video Transcript
Add the YouTube Transcript node from the YouTube Transcription package. Connect it after the metadata node.
This node retrieves the automatically generated transcript of the video if available.
Step 6: Split Transcript Into Parts
Add the Split Out node, set to split on the transcript field.
This prepares the text for processing large transcript lengths efficiently.
Step 7: Concatenate Transcript Pieces
Add the Summarize node (named “Concatenate”) configured to concatenate all split transcript pieces into a single string.
Step 8: Generate Structured Summary and Analysis
Add the Langchain Chain LLM node called “Summarize & Analyze Transcript”. Paste the detailed prompt as configured in the workflow which:
- Requests a markdown formatted summary with level 2 headers, bullet points, bold key terms, tables for comparisons
- Preserves technical accuracy and organizes definition, characteristics, implementation details, pros/cons
This is the AI brain generating valuable readable summaries.
Step 9: Assemble the Response Object
Add a Set node (“Response Object”) to map the video title, description, YouTube URL, generated summary, and other fields for easy access downstream.
Step 10: Respond to Webhook and Notify via Telegram
Add the Respond to Webhook node to send the assembled summary response back to the service that called the webhook.
Then, add the Telegram node to send a notification message containing the video title and URL to your configured Telegram channel or group.
Common mistake: Not setting up Telegram bot credentials correctly, resulting in send failures.
Customizations ✏️
- Change Notification Message Format: In the Telegram node, edit the
textfield to include more video metadata or a custom message style. - Add Language Filters: In the YouTube Transcript node, configure language preferences to target specific transcript languages if videos are multilingual.
- Integrate with Slack Instead of Telegram: Replace the Telegram node with a Slack node and map the summary message to Slack channels.
- Further Text Analysis: Add an additional AI node after summarization for sentiment analysis or keyword extraction.
Troubleshooting 🔧
Problem: “Video transcript not available or empty transcript field.”
Cause: Many YouTube videos do not have autogenerated transcripts or the transcript language is unsupported.
Solution: Confirm transcript availability on YouTube directly or fallback with manual transcription services.
Problem: “Regex in Code node failed to extract video ID.”
Cause: The input URL format may not match expected patterns, or contains extra URL parameters.
Solution: Test your URL format by logging the input to the code node and adjust regex accordingly.
Problem: “Telegram messages are not sent.”
Cause: Telegram bot credentials or chat IDs not configured correctly.
Solution: Review bot API token, chat permissions, and ensure the bot is added to the chat or channel.
Pre-Production Checklist ✅
- Verify your YouTube API credentials and permissions
- Test webhook POST calls with valid YouTube URLs
- Confirm transcript availability for test videos
- Check Telegram bot setup by sending test messages manually
- Test full workflow end-to-end to validate response and notifications
- Backup your n8n workflow JSON for rollback
Deployment Guide
Activate the webhook node by enabling the workflow in n8n. Deploy n8n on cloud or your preferred self-hosting environment for continuous operation. Use built-in execution logs to monitor workflow runs and errors. Schedule periodic tests to ensure transcript and Telegram integrations remain healthy.
FAQs
Q: Can I use other messaging apps instead of Telegram?
A: Yes, you can replace the Telegram node with Slack or email nodes depending on your team’s preference.
Q: Does this workflow use a lot of OpenAI tokens?
A: The summarization node sends large transcript texts so token usage depends on video length; monitor usage accordingly.
Q: Is my YouTube video data secure?
A: Your video metadata and transcript data remain within your n8n environment; ensure you secure access to n8n.
Q: Can this handle playlists or multiple videos?
A: This workflow processes one video URL at a time; for playlists, consider extending logic with looping or batch processing.
Conclusion
By completing this workflow, you’ve automated transforming verbose YouTube videos into concise, structured summaries and shared timely notifications via Telegram. This saves you hours of manual work, reduces errors, and keeps your team aligned with up-to-date content highlights.
Next, consider expanding this workflow for multi-language support or integrating with other social media platforms to maximize your content reach. You’re now equipped to handle video content more efficiently with n8n!