YouTube Content Idea Generation and SEO Optimization with AI - n8n Workflow

Use this powerful n8n workflow to automate trending YouTube video research. Scrape hot videos, analyze thumbnails with GPT, and generate optimized titles, thumbnail text, and unique video outlines directly into Google Sheets. Leverage n8n templates for content velocity.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content Creators and YouTubers looking for proven video ideas.

  • SEO Specialists focused on trending video topics.

  • Marketing teams needing rapid content pipeline generation.

  • n8n users who want advanced examples of integrating scraping, AI, and Google Sheets.

Overview

Generating high-performing video ideas requires constant market research and deep analysis—a time-consuming process. This advanced n8n workflow solves this by automating the entire research cycle. It starts by scraping trending videos related to a specific keyword, then applies a unique filter to identify truly overperforming content (videos with disproportionately high views relative to the channel size).

Once identified, the video is passed through a sequence of AI analysis steps using multiple OpenAI n8n node instances. This process includes analyzing the visual style of the thumbnail, extracting the full video transcript, and finally generating an SEO-optimized title, compelling thumbnail text, and a differentiated new outline. All structured data, including the AI outputs, is meticulously stored in a Google Sheets spreadsheet, providing a centralized and organized content strategy dashboard. This robust n8n workflow transforms manual research into a scalable automation process.

How it Works

The entire process is initiated by an n8n trigger, specifically the Form Trigger, which prompts the user to input a 'Keyword or Topic'.


  1. Scraping: The keyword is sent via an HTTP Request n8n node to the Apify YouTube Scraper, pulling recent, top-performing videos matching the search query.

  2. Filtering High-Potential Videos: The scraped data enters an If n8n node, which filters videos that meet strict criteria: over 1,000 views AND a view count higher than the channel's subscriber count, identifying viral content.

  3. Deduplication: The workflow checks the target Google Sheet (Find Duplicate Entries) to see if the video ID already exists. A Merge n8n node ensures that only unique, new videos proceed, preventing duplicate work.

  4. Initial Storage: The metadata for the newly identified, high-potential videos is written to the Google Sheets using the Step 1 Results n8n node.

  5. AI Analysis (Parallel): Two parallel paths start:

a. The Analyze Thumbnail OpenAI n8n node uses GPT-4o-mini's vision capabilities on the video's thumbnail URL to generate a natural language description of its visual style.
b. A second HTTP Request n8n node (Apify) scrapes the full video transcript (captions).

  1. AI Content Generation: The YouTube Title Generator OpenAI n8n node consumes the original title, the thumbnail description, and the transcript to produce an optimized newTitle and concise thumbnailText in a structured JSON format.

  2. Outline Creation: The Outline Generator OpenAI n8n node uses the transcript to craft a completely unique and improved video outline, providing a fresh angle for content development.

  3. Final Update: The Update Rows Google Sheets n8n node uses the video ID to update the previously created row with all the AI-generated content (new title, thumbnail text, transcript, outline, and thumbnail description). This completes the automated content research cycle using this specific n8n workflow.

Installation Guide

To deploy this powerful n8n workflow, follow these setup steps:


  1. Import the n8n template: Copy the provided JSON code and import it into your n8n instance.

  2. Apify Credentials: This n8n workflow relies on two HTTP Request nodes for scraping. You must replace in the Authorization header of the YouTube Video Scrape and the transcript HTTP Request nodes with a valid Apify API token.

  3. OpenAI Credentials: Set up a secure credential connection in n8n for OpenAI. Ensure this credential is used across the three OpenAI n8n node instances: Analyze Thumbnail, YouTube Title Generator, and Outline Generator.

  4. Google Sheets Setup:

Create or clone the target Google Sheet to store the data.
Configure your Google Sheets n8n credentials (OAuth2 is recommended).
* Update the documentId and sheetName parameters in the Step 1 Results, Find Duplicate Entries, and Update Rows n8n node settings to point to your specific spreadsheet and sheet ID.

  1. Execution: Once credentials are set, activate the n8n trigger (On form submission) to start researching topics.

Node Details

On form submission (n8n trigger): The entry point of the n8n workflow. It collects the user's research topic via a public form interface.
YouTube Video Scrape (HTTP Request n8n node): Uses the Apify API to fetch trending YouTube video metadata based on the form input. It is crucial for gathering raw data into the n8n template.
If (n8n node): Filters the scraped data to identify videos where the viewCount is highly disproportionate to the numberOfSubscribers, indicating rapid current growth.
Find Duplicate Entries & Merge (Google Sheets/Merge n8n nodes): These nodes manage data integrity. They check the Google Sheet for existing video IDs and use the Merge n8n node in 'keep non-matches' mode to process only truly new videos.
Step 1 Results (Google Sheets n8n node): Appends the initial metadata of high-potential videos to the sheet.
Analyze Thumbnail (OpenAI n8n node): Utilizes GPT-4o-mini's image analysis to generate a descriptive paragraph of the thumbnail's visual style, a key piece of data for the title generation step.
HTTP Request (Transcript Scraper n8n node): Retrieves the video transcript using a separate Apify actuator, providing the rich content needed for AI analysis.
YouTube Title Generator (OpenAI n8n node): An advanced AI n8n node using system instructions and data from previous steps (title, transcript, thumbnail analysis) to generate an optimized title and thumbnail text in a JSON output format.
Outline Generator (OpenAI n8n node): Leverages the transcript to create a completely new, unique video outline, ensuring the new content is differentiated from the original. This uses a powerful instructional prompt within the n8n node configuration.
Update Rows (Google Sheets n8n node): The final action of this n8n workflow, updating the corresponding row in the spreadsheet with all the newly generated, highly valuable AI content ideas.

Related n8n Workflows

Free

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

Featured*