YouTube Video Analysis and Structured Content Generation - n8n Workflow

Automate YouTube video analysis using a powerful n8n workflow. Generate transcripts, summaries, scene descriptions, and social media clips using the Gemini API. This n8n template speeds up content creation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content Marketers who need quick summaries and SEO descriptions for videos.

  • Researchers who require timestamped transcripts or detailed scene descriptions.

  • Social Media Managers looking to extract viral clips and rationales from long-form video content.

  • Anyone seeking a highly flexible, multimodal n8n workflow for large-scale media processing.

Overview

Manually analyzing video content, creating transcripts, or writing detailed scene descriptions is time-consuming and inefficient. This specialized n8n workflow solves this by utilizing the Google Gemini API's multimodal capabilities, allowing the AI to 'watch' the video linked via URL.

This single n8n template can execute five distinct tasks based on a simple input variable (promptType). Whether you need a simple summary, a full transcript, or complex visual analysis (like scene identification), this n8n automation delivers structured, high-quality output. The structure of this n8n node setup ensures that the automation is easily adaptable; you can modify the default prompts or switch the initial n8n trigger to integrate this processing into a larger system (like connecting it to a Google Sheets or Airtable data source).

How it Works

The n8n workflow begins with the 'When clicking ‘Test workflow’' n8n trigger, which initiates manual execution. The flow then proceeds through the following steps:


  1. Define Variables: The 'Set: Define Initial Variables' n8n node defines critical parameters, including the youtubeURL, the necessary apiKey for the Gemini API, and the crucial promptType (e.g., 'transcript', 'summary', 'clips').

  2. Logic Branching: The 'Switch: What kind of question do we want to ask?' n8n node evaluates the promptType. This core logic element routes the flow to one of five specialized Set nodes, each containing a different, highly optimized instruction set for the AI model.

  3. Prompt Selection: Based on the switch result, one of the dedicated Set nodes (e.g., 'Set: Transcript Prompt', 'Set: Scene Clips') is executed, adding the specific AI prompt and the desired model (gemini-1.5-flash) to the item data.

  4. Data Merge: The flow consolidates the video URL, API key, and selected prompt into the 'Set: Merged Values' n8n node.

  5. API Execution: The 'HTTP Request to Google' n8n node sends a POST request to the Gemini endpoint. The request dynamically uses the variables for the API key and model and includes the video URL within the file_data field, enabling multimodal analysis.

  6. Data Re-merging: After receiving the raw JSON response from Google, the 'Code: Merge data from prior nodes with HTTP Output' n8n node ensures that the original input data is merged with the API output, preventing loss of context.

  7. Output Extraction: The final 'Set Fields: Define Outcome' n8n node simplifies the complex API response, extracting the cleanly generated text (answerAIGenerated), token counts, and the model version used, providing a clean final output ready for the next step in your n8n workflow.

Installation Guide

To deploy this useful n8n workflow template, follow these steps:


  1. Import: Copy the entire provided JSON and import it into your n8n instance via the 'Workflows' section using the 'Import from JSON' button.

  2. API Key Setup: This n8n workflow requires a Google API key, accessible via the Google Developer Console or AI Studio. Obtain your key.

  3. Configure Variables: Navigate to the 'Set: Define Initial Variables' n8n node.

Replace enter-your-api-key-here in the apiKey assignment with your actual Google API key.
Set the youtubeURL to the public URL of the video you wish to analyze.
* Set the promptType to one of the following lowercase values: transcript, timestamps, summary, scene, or clips.

  1. Test: Click the 'When clicking ‘Test workflow’' n8n trigger, ensure the workflow is active, and click 'Test Workflow' to verify the AI processing.

Node Details

Manual Trigger n8n Trigger: Starts the n8n workflow upon manual initiation, ideal for testing or ad-hoc runs.
Set: Define Initial Variables (Set n8n node): Crucial for defining the video URL and the desired operation (promptType). This centralized configuration makes the n8n template easily reusable.
Switch: What kind of question do we want to ask? (Switch n8n node): This core control flow n8n node directs the automation based on the promptType input variable, allowing one n8n workflow to handle multiple content generation tasks efficiently.
Set: [Prompt Name] (Set n8n nodes): Defines the specific, optimized text prompt and the gemini-1.5-flash model for the AI request. Examples include creating social media clips or generating a verbatim transcript.
HTTP Request to Google (HTTP Request n8n node): The main execution n8n node. It dynamically constructs the Gemini API request, embedding the YouTube URL as a file URI for multimodal processing.
Code: Merge data from prior nodes with HTTP Output (Code n8n node): A technical n8n node that ensures data integrity by combining the original input data with the processed API response, simplifying subsequent data access.


  • Set Fields: Define Outcome (Set n8n node): Cleans and structures the final output from the API response, providing easily readable fields like answerAIGenerated and various token counts for analysis.

Related n8n Workflows

Free

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

Experienced NoCode builder

Featured*