YouTube Video Transcript Extractor via External API - n8n Workflow

Use this robust n8n workflow to extract and clean video transcripts from any public YouTube Video ID using an external API. Essential for AI summarization pipelines.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content creators needing to repurpose video content.

  • Data scientists and analysts performing sentiment analysis on video content.

  • Developers building custom n8n templates for AI summarization.

  • Anyone requiring a reliable, non-OAuth method for extracting YouTube transcripts.

Overview

This expert n8n workflow provides a streamlined method for obtaining clean, structured transcripts from public YouTube videos. Unlike solutions requiring complex YouTube Data API credentials and OAuth setup, this automation leverages a dedicated external transcript service (youtube-transcript.io).

The entire n8n workflow is designed as a reusable component, triggered by another main workflow and requiring only the youtubeVideoId as input. The core value lies in the robust parsing and cleaning steps implemented using a custom n8n node, ensuring the output is standardized, free of timestamps, and ready for advanced natural language processing (NLP) or AI summarization tasks. This reliable n8n node sequence makes this one of the most efficient n8n templates for media pipeline integration.

How it Works

The execution of this n8n workflow follows a five-step process, starting with data ingestion and ending with structured, cleaned text or a defined error:


  1. Input Trigger: The process begins with the When Executed by Another Workflow n8n trigger, which signals that this sub-workflow has been called. It expects the youtubeVideoId to be passed as a parameter.

  2. Input Setup: The Set Variables n8n node stores the input video ID securely, making it easily accessible for subsequent nodes.

  3. API Request: The Get Transcript (YouTube Transcript API) n8n node sends a POST request to the youtube-transcript.io API. It includes the video ID in the JSON body. It is configured to receive the full response as text for maximized robustness.

  4. Data Parsing and Validation: The Parse API Response code n8n node handles the API's output. It includes error handling (try/catch) for parsing and attempts to extract the transcript text regardless of slight variations in the API's JSON response structure.

  5. Flow Control: The IF Has Transcript? n8n node directs the flow based on the presence of the extracted text. If text exists, it proceeds to cleaning; if not, it proceeds to error handling.

  6. Success Path (Cleaning): The Clean Transcript code n8n node removes all unnecessary metadata, including line breaks and excessive whitespace, and filters out typical transcription cues like [Music]. It then returns the final, clean text along with calculated metrics (wordCount, charCount).

  7. Failure Path (Error): If the transcript is missing, the No Transcript Fallback code n8n node structures an error payload, and the Stop and Error n8n node halts the parent n8n workflow execution gracefully.

Installation Guide

To use this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance using the 'New' menu -> 'Import from JSON'.

  2. Credentials: This specific n8n workflow relies on the free tier of the youtube-transcript.io API, which typically does not require API keys for simple GET/POST requests, but ensure the Get Transcript (YouTube Transcript API) n8n node settings are correct for your configuration.

  3. Integration: Since this uses the Execute Workflow n8n trigger, you must call it from a primary n8n workflow using the 'Execute Workflow' n8n node, passing the youtubeVideoId as an input parameter.

Node Details


  • When Executed by Another Workflow (n8n trigger): Acts as the entry point, defining the required input parameter youtubeVideoId.

  • Set Variables (n8n node): Standardizes the input data to ensure the youtubeVideoId is easily referenceable throughout the rest of the n8n workflow.

  • Get Transcript (YouTube Transcript API) (HTTP Request n8n node): Sends a POST request to the external transcript service. Key configurations include setting the method to POST, the URL to the transcript API endpoint, and configuring the response to be processed as 'Full Response' and 'text' for robust parsing.

  • Parse API Response (Code n8n node): This crucial custom n8n node handles safe JSON parsing and standardizes the output fields (text, language) from potentially varying API response structures.

  • IF Has Transcript? (IF n8n node): A logic gate that checks if the text field extracted in the previous n8n node is non-null and non-empty.

  • Clean Transcript (Code n8n node): Performs final text sanitization (removing newlines, excessive space, and [Music] annotations) and generates useful metrics like word and character counts, finalizing the successful output of the n8n workflow.

  • Stop and Error (n8n node): Ensures the parent n8n workflow receives a clear indication of failure if a transcript cannot be found, preventing silent execution errors.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Featured*