Skip to main content

Auto-generate YouTube chapters with Gemini AI & YouTube Data API v3

Workflow preview

Workflow preview
100%
Auto-generate YouTube chapters with Gemini AI & YouTube Data API v3 preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Auto Generate YouTube Chapters with AI Powered Transcript Analysis Overview This workflow uses YouTube Data API v3 and Google Gemini 1.5 Flash AI to automatically generate timestamped chapters for ...

Best for

  • Content Creation automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.youtube, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.chainllm

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by irfan saeed.

Original n8n.io source

1.1 Workflow description

Title
Auto-generate YouTube chapters with Gemini AI & YouTube Data API v3
Workflow name
Auto-generate YouTube chapters with Gemini AI & YouTube Data API v3

Auto-Generate YouTube Chapters with AI-Powered Transcript Analysis

Overview

This workflow uses YouTube Data API v3 and Google Gemini 1.5 Flash AI to automatically generate timestamped chapters for videos by analyzing SRT captions. It enhances viewer navigation, improves SEO , and saves creators time by automating manual tasks.


Prerequisites

YouTube API Setup
  1. Create a Google Cloud Project

    • Go to the Google Cloud Console.
    • Click Select a project > New Project and name it (e.g., "YouTube Chapters Automation") .
  2. Enable YouTube Data API v3

    • Navigate to APIs & Services > Library.
    • Search for "YouTube Data API v3" and click Enable .
  3. Configure OAuth Consent Screen

    • Go to APIs & Services > OAuth consent screen.
    • Select External (public) or Internal (testing), then add required details (app name, support email) .
  4. Generate OAuth 2.0 Credentials

    • Under Credentials, click Create Credentials > OAuth client ID.
    • Choose Web app, then download the JSON key file .
  5. Add Credentials to n8n

Other Requirements
  • Google Gemini API: Configure access for the gemini-1.5-flash-8b-exp-0924 model by getting the api key.

Workflow Steps

  1. Set Video ID

    • Input the target video ID (e.g., r1wqsrW2vmE) using the Set Video ID node.
  2. Fetch Video Metadata

    • Use the YouTube API node to retrieve the video’s title, category, and existing description .
  3. Download SRT Captions

    • Get Caption ID: Call https://www.googleapis.com/youtube/v3/captions to fetch the caption track ID .
    • Download Transcript: Use the ID to retrieve SRT data via https://www.googleapis.com/youtube/v3/captions/{{ID}}?tfmt=srt .
  4. Analyze Transcript with Gemini AI

    • Process the SRT file with Google Gemini AI to identify chapters using a prompt like:
      "Classify this transcript into timestamped chapters (e.g., 00:00 - Introduction)."  
      
    • Validate output with a structured parser (e.g., Structured Captions node) .
  5. Update Video Description

    • Append chapters to the description using the YouTube API’s videos.update method .

Value Proposition

  • Viewer Experience: Chapters improve navigation and reduce drop-off rates .
  • SEO Benefits: Structured descriptions enhance search visibility .
  • Time Savings: Eliminates manual chapter creation .

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Get Caption ID

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Get Captions

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Extract Captions

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 5 - Structured Captions

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 6 - Get Video Meta Data

Type / Role
n8n-nodes-base.youTube - youTube
Config choices
Version 1

Block 7 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 8 - Set Video ID

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Update Chapters

Type / Role
n8n-nodes-base.youTube - youTube
Config choices
Version 1

Block 10 - Tag Chapters in Description

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 11 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Auto-generate YouTube chapters with Gemini AI & YouTube Data API v3
Complexity intermediate
Nodes 13
Categories Content Creation, AI Summarization
Author irfan saeed
Published 06 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3450/3450.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Auto-generate YouTube chapters with Gemini AI & YouTube Data API v3 do?

Auto Generate YouTube Chapters with AI Powered Transcript Analysis Overview This workflow uses YouTube Data API v3 and Google Gemini 1.5 Flash AI to automatically generate timestamped chapters for ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, AI Summarization use case.