Skip to main content

Detect viral YouTube videos with AI analysis and email reports

Workflow preview

Workflow preview
100%
Detect viral YouTube videos with AI analysis and email reports preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Analyze YouTube videos for virality with an AI powered report This workflow automates the discovery and analysis of potentially viral YouTube videos. It searches for recent, popular videos based on...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.toolthink, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.sort, n8n-nodes-base.scheduletrigger, n8n-nodes-base.httprequest

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Detect viral YouTube videos with AI analysis and email reports
Workflow name
Detect viral YouTube videos with AI analysis and email reports

Analyze YouTube videos for virality with an AI-powered report

This workflow automates the discovery and analysis of potentially viral YouTube videos. It searches for recent, popular videos based on a keyword, calculates a unique "Algorithmic Lift Score" to measure virality, and uses an AI agent to generate an insightful summary report that is sent directly to your email.

What it does

This workflow identifies videos that are outperforming their channel's baseline, a key indicator of viral potential. It operates in several stages:

  1. Searches YouTube: It finds recent, top-performing videos based on your specified keyword and timeframe.
  2. Gathers Data: For each video found, it fetches detailed statistics for both the video (views, likes, comments) and its channel (subscriber count, total views).
  3. Calculates Virality Score: It calculates an "Algorithmic Lift Score" for each video. This custom metric prioritizes videos that achieve high view counts and engagement relative to their channel's subscriber base.
  4. Analyzes with AI: The top 5 videos, sorted by their virality score, are sent to an AI agent (pre-configured for OpenAI). The AI generates a concise summary highlighting trends, top performers, and other noteworthy patterns.
  5. Sends Email Report: The final AI-generated analysis is converted to HTML and emailed to you, providing a ready-to-read report on what's trending in your niche.

Who it's for

This workflow is perfect for:

  • Content Creators looking for trending topics and content ideas.
  • Digital Marketers conducting competitor analysis or market research.
  • Social Media Managers wanting to understand what content resonates on YouTube.
  • Data Analysts who need to automate the collection and analysis of YouTube trends.

Requirements

  • A Google API Key with the "YouTube Data API v3" enabled.
  • An OpenAI API Key (or another compatible AI model credential).
  • A connected Gmail account in n8n to send the final report.

How to set up

  1. Configure the Setup Node: Click on the "Setup" node and fill in the values:
    • query: The keyword you want to search for (e.g., "AI tools").
    • GoogleAPIkey: Your Google API key.
    • daysback: How many days in the past to search for new videos.
    • maxResult: The number of videos to analyze (e.g., 20).
    • email: The email address where the report will be sent.
  2. Set AI Credentials: Click the "OpenAI Chat Model" node and add your OpenAI API key to the credentials.
  3. Set Gmail Credentials: Click the "Send_Report" node and connect your Gmail account to the credentials.

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 - CalculateMetrics

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

Block 3 - AI Agent

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

Block 4 - Think

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

Block 5 - OpenAI Chat Model

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

Block 6 - Sort

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

Block 7 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 8 - GetChannelInfo

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

Block 9 - SearchVideos

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

Block 10 - Split Out1

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

Block 11 - Split Out2

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

Block 12 - GetVidStats

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

Block 13 - ChannelInfo

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

Block 14 - VidStats

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

Block 15 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 16 - AlgorithmicLiftScore

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

Block 17 - Setup

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

Block 18 - Remove_Duplicates

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

Block 19 - Sticky Note

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

Block 20 - Limit

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

Block 21 - Aggregate

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

Block 22 - Markdown

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

Block 23 - Sticky Note1

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

Block 24 - Sticky Note2

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

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

3. Summary Table

Workflow Detect viral YouTube videos with AI analysis and email reports
Complexity advanced
Nodes 26
Categories Market Research, AI Summarization
Author gclbck
Published 08 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8368/8368.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 Detect viral YouTube videos with AI analysis and email reports do?

Analyze YouTube videos for virality with an AI powered report This workflow automates the discovery and analysis of potentially viral YouTube videos. It searches for recent, popular videos based on...

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 Market Research, AI Summarization use case.