Skip to main content

YouTube Videos to Viral X Threads by Keywords (using Gemini & Claude)

Workflow preview

Workflow preview
100%
YouTube Videos to Viral X Threads by Keywords (using Gemini & Claude) preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Who is this for? Content creators, marketers, and social media managers who want to turn high performing YouTube videos into viral X (Twitter) threads using keywords (without manual research). Perf...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.filter, n8n-nodes-base.limit, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.lmchatanthropic, n8n-nodes-base.formtrigger, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
YouTube Videos to Viral X Threads by Keywords (using Gemini & Claude)
Workflow name
YouTube Videos to Viral X Threads by Keywords (using Gemini & Claude)

Who is this for?

Content creators, marketers, and social media managers who want to turn high-performing YouTube videos into viral X (Twitter) threads using keywords (without manual research). Perfect for anyone looking to systematically create engaging social content from proven video sources.


What problem does it solve?

Finding viral content ideas and writing engaging threads is time-consuming and hit-or-miss. This workflow automates the entire process: discovers high-performing YouTube videos based on your keywords, extracts key insights using AI, and generates multiple viral thread variations using proven patterns from 12.5M+ view threads.


How it works

# Node Purpose
1 Form Trigger Captures your keyword, target audience, and content type preferences.
2 YouTube Video Search Finds recent videos (April 2025+) matching your keyword, sorted by view count.
3 Get Video Statistics Fetches detailed metrics (views, engagement) for discovered videos.
4 Filter High-Performers Keeps only videos with 100K+ views and excludes YouTube Shorts.
5 Top 5 Selection Limits to the best 2 videos to focus on proven winners.
6 Save Video Candidates Logs discovered videos to Google Sheets for manual approval.
7 Wait & Check Approval Pauses 30 seconds, then checks which videos you marked "Yes" for thread generation.
8 Video Analysis (Gemini) Uses Google's Gemini AI to extract key insights, tools, and strategies from approved videos.
9 Thread Generation (Claude) Applies viral thread database patterns to create 3 distinct thread variations using Claude Sonnet 4.
10 Structure & Save Threads Formats the generated threads and saves them back to Google Sheets for review and posting.

Setup steps

  1. Import & configure credentials
  • Import the JSON workflow into n8n
  • Add your YouTube Data API key (get from Google Cloud Console)
  • Add your Google Gemini API key (get from Google AI Studio)
  • Connect Anthropic API for Claude access
  • Set up Google Sheets OAuth2 credential
  1. Create your tracking spreadsheet
  • The workflow auto-creates a sheet with columns: Keyword, Youtube video title, Description, Video URL, Turn into thread?, Thread 1, Thread 2, Thread 3
  • You'll manually review and mark videos "Yes" in the Turn into thread? column
  1. Configure the viral thread database
  • The workflow includes proven patterns from threads with 12.5M+ views
  • Adjust the target audience and content style in the AI prompts if needed
  1. Test the workflow
  • Submit the form with a keyword like "AI automation"
  • Check that videos appear in your Google Sheet
  • Mark one "Yes" and verify threads are generated

Resources


Extending the workflow

  • Auto-posting – Connect X API to automatically post generated threads
  • Competitor tracking – Monitor specific channels for new content opportunities
  • Multi-platform – Adapt threads for LinkedIn, Instagram, or TikTok formats
  • Performance tracking – Log thread performance back to sheets for optimization
  • Webhook triggers – Set up Zapier integration for form submissions from other tools

Transform proven YouTube content into viral social media threads—systematically and at scale.

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 - Filter High-Performing Videos

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 2 - Top 5 Videos

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

Block 3 - Structure Thread Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Save to Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 5 - Get videos

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

Block 6 - Get statistics

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

Block 7 - Anthropic Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.3

Block 8 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 9 - Sticky Note

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

Block 10 - Add context file

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Clean data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Sticky Note2

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

Block 13 - Sticky Note3

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

Block 14 - Sticky Note4

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

Block 15 - Sticky Note5

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

Block 16 - Sticky Note7

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

Block 17 - Split Batch

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Add to Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 19 - Extract Video Summary

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

Block 20 - Create Threads

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 21 - Key Word + Audience + Tone

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

Block 22 - Keys: YT + Gemini

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

Block 23 - Wait 30s

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 24 - Filter by 'Yes'

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow YouTube Videos to Viral X Threads by Keywords (using Gemini & Claude)
Complexity advanced
Nodes 25
Categories Content Creation, Multimodal AI
Author Matty Reed
Published 16 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4974/4974.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 YouTube Videos to Viral X Threads by Keywords (using Gemini & Claude) do?

Who is this for? Content creators, marketers, and social media managers who want to turn high performing YouTube videos into viral X (Twitter) threads using keywords (without manual research). Perf...

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, Multimodal AI use case.