Convert YouTube Videos to Audio Summaries with n8n
Send a link via Telegram → Decodo extracts transcript → OpenAI generates summary script and audio → Telegram returns MP3 and structured text
- Who
- Users who want audio summaries of YouTube videos via a Telegram bot
- You get
- Receive an MP3 audio summary plus a formatted message with genre tag, title, and text summary
Constraints
Requires an internet-connected n8n instance (self-hosted or cloud) with three credentials: telegramApi (Telegram bot), decodoApi (Decodo web scraping API), openAiApi (OpenAI). Set output_language in the Config node (default: English).
What they did
Author attakhalighi published a workflow template in the n8n official template library. The template receives YouTube links via Telegram bot, validates the URL, extracts captions using Decodo, flattens the JSON via a Code node, generates a structured audio summary script with gpt-4o-mini (including genre, title, summary, and spoken text), converts it to MP3 via OpenAI TTS, and sends both audio and text back to the user through Telegram.
How it went
The source description states the workflow transforms any YouTube video into a high-quality spoken audio summary (MP3) and structured text overview, supports multi-language output, and gracefully handles videos without captions. (author_report)
Worth knowing
The speech generation model is noted as tts-1 in source sticky notes, but this parameter is not explicitly exposed in workflow.json; actual model selection may depend on the OpenAI node version. The Decodo node is a third-party community node requiring manual installation. The source contains promotional links (Decodo coupon ATTAN8N); we have not verified this offer. The workflow has not been tested by our site; verify API quotas and network connectivity before reproducing.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Send Working on it Message node: connect Telegram API credentials.
- Send Error Message node: connect Telegram API credentials.
- Send Transcript Failed Message node: connect Telegram API credentials.
- Send Text Summary node: connect Telegram API credentials.
- Telegram Trigger node: connect Telegram API credentials.
- Decodo (Fetch Transcript) node: connect decodoApi credentials.
- OpenAI TTS (Create Audio) node: connect OpenAI API credentials.
- Send Audio Summary node: connect Telegram API credentials.
- OpenAI Chat Model node: connect OpenAI API credentials.
Configuration to replace
- Source template is n8n public workflow #10981 (~24 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Configure workflow and credentials
After importing the template into n8n, configure credentials: Telegram Bot Token, Decodo API Key, and OpenAI API Key. Double-click the Config node to set output_language (e.g., English, Spanish, German). The AI summary and speech will adapt to this language.
Trigger by sending a YouTube link via Telegram
Send a YouTube video link to the connected Telegram bot (supports youtube.com/watch?v=... or youtu.be/... formats).
Validate URL with regex
The workflow uses an If node with a regex to check whether the message contains a valid YouTube URL. If invalid, the bot replies with an error. If valid, it proceeds and sends a "Found it! 🎬 fetching transcript..." waiting message.
Fetch transcript with Decodo
The Decodo node scrapes the full transcript JSON from the video page. Configure your Decodo API credential in the node and ensure the operation is set to youtube_transcript.
Check for transcript extraction errors
An If node checks whether the Decodo result contains an error. If the video has no captions or extraction fails, the bot sends an error notification and the workflow stops.
Execution prompt · Source text。Send Transcript Failed Message node text field
=⚠️ **Transcript Failed** I couldn't extract text from this video. It might not have captions available. **Reason:** {{ $json.results[0].content.error.message }}Format transcript with Code node
The Code node flattens the deep JSON structure from Decodo into a clean text string for the AI to read.
Execution prompt · Source text。Code: Format Transcript node JS Code field
const content = $input.first().json.results?.[0]?.content; // Safety check: Ensure content is actually an array (valid transcript) // If it's an object (error) or null, return empty text. if (!Array.isArray(content)) { return [{ json: { transcript: "" } }]; } const fullText = content.map(item => { return item.transcriptSegmentRenderer?.snippet?.runs?.[0]?.text || ""; }).join(' '); return [{ json: { transcript: fullText } }];AI Agent generates structured summary script
The AI Summarizer node (Agent type) connects to an OpenAI Chat Model (gpt-4o-mini) and a Structured Output Parser. The user message passes the formatted transcript; the system prompt instructs the AI to output JSON in the configured language, containing genre, title, summary, and script (for TTS, under 300 words, must start with "This is a summary of the video...").
Execution prompt · Source text。AI Summarizer node text / user message field
=**Input Transcript:** {{ $json.transcript }}Execution prompt · Source text。AI Summarizer node options.systemMessage field
=You are an expert Audio Summarizer. Your goal is to convert raw video transcripts into clear, concise, and easy-to-listen-to summaries. **CRITICAL INSTRUCTION:** You MUST write the entire summary, title, and script in **{{ $('Config').item.json.output_language }}**. **Phase 1: Analyze the Content** Determine the core subject matter (e.g., Cooking, Tech, History, News) and adopt a tone that fits: * **Educational:** Clear, instructional, and logical. * **News/Business:** Professional, objective, and direct. * **Story/Entertainment:** Engaging but descriptive. **Phase 2: Critical Content Extraction** **Do not miss the main point.** Identify the central argument, key facts, or the most valuable takeaway. The summary must deliver the value of the video without the fluff. **Phase 3: Script Guidelines** 1. **The Opening:** You MUST start the script with the phrase: "This is a summary of the video..." followed by the main topic or title. 2. **No Visual Cues:** The listener cannot see the video. Do NOT use phrases like "as you can see" or "in this chart." Rephrase them verbally. 3. **Direct & Clean:** Remove filler words, speaker labels, and conversational tangents. Just deliver the information. 4. **Strict Length:** The script must be **less than 300 words**. **Output Schema (Strict JSON):** You must output a single valid JSON object. Do not wrap it in markdown code blocks. Use this exact structure: { "genre": "The detected genre (e.g., 'True Crime', 'Cooking', 'Tech News')", "title": "A descriptive title for the file", "summary": "A short, punchy 2-sentence text caption for Telegram.", "script": "The full text for the Text-to-Speech engine to read. Start with 'This is a summary of the video...'." }OpenAI TTS generates audio
The OpenAI TTS node receives the script field from the AI output and calls the OpenAI audio endpoint to generate an MP3 file. Source notes mention using tts-1 for fast generation.
Telegram delivers audio and text summary
The workflow sends two messages in sequence: first the MP3 audio file (Send Audio Summary), then a formatted HTML text summary (Send Text Summary) containing the title, genre tag, and summary.
Execution prompt · Source text。Send Text Summary node text field (HTML parse_mode)
=<b>{{ $('AI Summarizer').item.json.output.title }}</b> #{{ $('AI Summarizer').item.json.output.genre.replace(/ /g, '') }} <blockquote>{{ $('AI Summarizer').item.json.output.summary }}</blockquote>
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to recreate the "YouTube Video to Audio Summary" template. First confirm they have ready: an n8n instance, Telegram Bot Token, Decodo API Key, and OpenAI API Key. Then guide them to import the template, configure credentials, set output_language, and finally test by sending a YouTube link.
Before building, confirm all three API credentials are ready and set your target output language.
Source
Convert YouTube videos to audio summaries with Decodo, OpenAI & Telegram · attakhalighi · n8n.io · 2025-11-18
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.