🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

YouTube to Gmail, AI trend reports for marketers

Lisa Granqvist Partner Workflow Automation Expert

You search YouTube, open 12 tabs, copy a few links into a doc, then guess which videos are actually “breaking out.” It’s slow. And honestly, it’s easy to fool yourself with big view counts that don’t mean much.

Marketing managers feel it when they need fresh angles every week. Content strategists run into it when they’re pitching “what’s trending” with shaky evidence. Founders doing their own marketing get stuck here too. This YouTube trend automation gives you a scored, AI-written report in Gmail so you can pick smarter ideas in minutes.

Below you’ll see how the workflow finds breakout videos by keyword, calculates an Algorithmic Lift Score (a simple “viral potential” signal), and emails a clean summary you can act on.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: YouTube to Gmail, AI trend reports for marketers

The Problem: Trend Research Is Mostly Guesswork

Most “trend research” on YouTube turns into a messy mix of gut feel and vanity metrics. You spot a video with a lot of views, but you don’t know if it’s truly taking off or if the creator’s channel is always that strong. Then you try to compare five creators at once. That’s when the spreadsheet starts. Links get lost, stats change overnight, and your final “insights” are basically a screenshot plus vibes. Meanwhile, you still have to write the recap and send it to the team.

The friction compounds. Here’s where it breaks down.

  • You waste about 2 hours per research session jumping between search results, channels, and individual video pages.
  • Big channels dominate your shortlist even when smaller channels are the ones showing real breakout velocity.
  • Manual copy-paste leads to missing context, like subscriber counts or channel baselines, so your comparisons aren’t fair.
  • Your “report” becomes another task, which means it ships late or not at all.

The Solution: Automated YouTube Virality Reports to Gmail

This workflow turns one keyword into a prioritized list of breakout videos, plus an AI summary you can forward instantly. It starts with a trigger (manual or scheduled), then searches YouTube for recent top-performing videos in your chosen timeframe. For every result, it pulls the extra data humans usually skip: detailed video stats and the channel’s baseline (subscribers and overall performance). Next, it calculates an “Algorithmic Lift Score” so you’re not just chasing raw views. Finally, it sends the top videos into an AI agent that writes a clear trend report, converts it into readable HTML, and emails it to you through Gmail.

The workflow kicks off when you run it on demand or on a schedule. Data gets gathered and merged across videos and channels, then ranked by lift score. The final output is a clean email report that highlights patterns, winners, and what’s worth copying (and what isn’t).

What You Get: Automation vs. Results

Example: What This Looks Like

Say you do YouTube trend research three times a week for one client niche. Manually, you might review 20 videos and 20 channels, spending maybe 5 minutes per pick once you count searching, checking channel size, and copying notes. That’s about 5 hours a week. With this workflow, you set the keyword once, let it collect and score up to 20 candidates, then you read the email with the top 5 and the AI summary in about 10 minutes. You get most of that time back, and the short list is backed by numbers, not hunches.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • YouTube Data API v3 for video and channel metrics.
  • Gmail to send the finished report to your inbox.
  • OpenAI API key (get it from your OpenAI dashboard).

Skill level: Intermediate. You’ll paste API keys, connect Gmail, and adjust a few parameters like keyword and days-back.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A scheduled run (or manual start) kicks things off. You can trigger it weekly, daily, or whenever you need a fresh scan. The workflow begins by loading your saved parameters like keyword, timeframe, and max results.

YouTube gets searched, then each result is expanded. n8n pulls a list of recent videos for your keyword, splits them into individual items, and extracts the fields needed for follow-up requests.

Channel stats and video stats are collected and combined. Separate API calls grab video metrics (views, likes, comments) and channel context (subscriber count, total views). The workflow merges these into one record per video, removes duplicates, then computes the lift score and sorts by that ranking.

An AI agent writes the report and Gmail delivers it. The top five videos are aggregated into a single prompt, summarized with your OpenAI-connected model, rendered into HTML, then emailed out as a ready-to-read trend briefing.

You can easily modify the keyword and days-back window to fit a product launch, a client niche, or a seasonal campaign. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Manual and Scheduled Triggers

Set up both on-demand and scheduled execution paths to start the workflow.

  1. Open Manual Start Trigger and leave default settings to enable manual runs.
  2. Open Scheduled Launch Trigger and set the schedule rule to trigger at Hour 13.
  3. Verify both Manual Start Trigger and Scheduled Launch Trigger connect to Initialize Parameters.

Step 2: Initialize Search Parameters

Define the YouTube query, time window, result limits, and recipient email.

  1. Open Initialize Parameters and set query to AIvideo.
  2. Set daysback to 3 and maxResult to 20.
  3. Set email to your report recipient address.
  4. Set GoogleAPIkey to your YouTube Data API key (currently blank).

⚠️ Common Pitfall: Leaving GoogleAPIkey or email empty will cause Search Video Results and Dispatch Report Email to fail.

Step 3: Fetch YouTube Video and Channel Data

Pull video search results, then expand and fetch both channel and video statistics.

  1. Open Search Video Results and confirm the query parameters include key ={{ $('Initialize Parameters').item.json.GoogleAPIkey }}, q ={{ $('Initialize Parameters').item.json.query }}, maxResults ={{ $('Initialize Parameters').item.json.maxResult }}, and publishedAfter ={{ $now.minus({ days: $('Initialize Parameters').item.json.daysback }).toUTC().toISO() }}.
  2. In Expand Items List, set fieldToSplitOut to items and fieldsToInclude to videoId,channelId, publishedAt, .
  3. In Extract Video Fields, set fieldToSplitOut to items.snippet.channelId and fieldsToInclude to items.snippet.channelId, items.snippet.publishedAt, items.id.videoId.
  4. Extract Video Fields outputs to both Fetch Channel Details and Fetch Video Metrics in parallel.
  5. In Fetch Channel Details, confirm url is https://www.googleapis.com/youtube/v3/channels? and query includes id ={{ $json['items.snippet.channelId'] }}.
  6. In Fetch Video Metrics, confirm url is https://www.googleapis.com/youtube/v3/videos? and id is ={{ $json['items.id.videoId'] }}.

Step 4: Parse, Merge, and Score Video Performance

Normalize channel/video data, remove duplicates, and compute virality metrics.

  1. Keep Parse Channel Data as-is to extract channelName, channelID, subscriberCount, and view counts from channel responses.
  2. Keep Parse Video Stats as-is to map categories and extract ViewCount, likeCount, commentCount, and publishedAt.
  3. In Combine Channel Video, ensure mode is combine and fieldsToMatchString is channelID.
  4. Run Eliminate Duplicates to prevent multiple entries for the same channel/video pair.
  5. Leave Compute Metrics and Compute Lift Score code blocks unchanged to calculate derived fields like viewsPerHour and algorithmicLiftScore.
  6. In Order by Lift, sort by algorithmicLiftScore in descending order.
  7. In Cap Top Results, set maxItems to 5 to limit the final selection.

Step 5: Aggregate and Summarize with AI

Aggregate the top results and generate a concise AI summary before formatting the report.

  1. In Aggregate Records, set aggregate to aggregateAllItemData.
  2. Open AI Summary Agent and confirm text is set to =json: {{$('Aggregate Records').item.json.data.toJsonString() }}.
  3. Ensure OpenAI Chat Engine is connected as the language model for AI Summary Agent and uses model gpt-4o-mini.
  4. Note that Reasoning Tool is an AI tool connected to AI Summary Agent; credentials should be added to OpenAI Chat Engine, not the tool node.

Credential Required: Connect your openAiApi credentials in OpenAI Chat Engine.

Step 6: Format and Send the Email Report

Convert the summary to HTML and email it to the recipient.

  1. In Render Markdown, set mode to markdownToHtml and markdown to ={{ $json.output }}.
  2. In Dispatch Report Email, set sendTo to ={{$('Initialize Parameters').item.json.email}}.
  3. Set message to ={{ $json.data }} and subject to =Virality analysis of the last {{ $('Initialize Parameters').item.json.daysback }} days for keyword: "{{ $('Initialize Parameters').item.json.query }}".

Credential Required: Connect your gmailOAuth2 credentials in Dispatch Report Email.

Step 7: Test and Activate Your Workflow

Run a full test to validate API calls, scoring, AI summary, and email delivery.

  1. Click Execute Workflow on Manual Start Trigger to run an end-to-end test.
  2. Confirm Search Video Results returns items and that Fetch Channel Details and Fetch Video Metrics both receive data in parallel.
  3. Verify Order by Lift and Cap Top Results produce a shortlist and AI Summary Agent outputs a concise summary.
  4. Check your inbox for the email sent by Dispatch Report Email with HTML-formatted content.
  5. When satisfied, toggle the workflow to Active so Scheduled Launch Trigger runs daily at the configured hour.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • YouTube Data API credentials can expire or lack the right permissions. If things break, check your Google Cloud Console API key restrictions and that “YouTube Data API v3” is enabled first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this YouTube trend automation automation?

About 30 minutes if you already have your API keys.

Do I need coding skills to automate YouTube trend automation?

No. You’ll mainly connect accounts and paste API keys. The only “technical” part is picking a keyword and timeframe that match your niche.

Is n8n free to use for this YouTube trend automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage costs (usually a few cents per report) and any Google API usage if you hit quota limits.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this YouTube trend automation workflow for multiple keywords?

Yes, but you’ll want to do it intentionally. Many teams duplicate the workflow and change the values in the “Initialize Parameters” node for each niche. If you prefer one workflow, you can pass a keyword in via Webhook or Telegram, then map it into the same parameters. Common customizations include changing daysback, raising maxResult, and editing the AI Summary Agent prompt so it writes in your house style.

Why is my YouTube connection failing in this workflow?

Usually it’s an API key restriction or the YouTube Data API v3 not being enabled in Google Cloud. Regenerate the key, confirm billing/quota status, and update the value in the parameters node. If it fails only sometimes, you may be hitting quota limits when you increase max results or run the workflow too often.

How many videos can this YouTube trend automation automation handle?

It’s designed to analyze a batch like 20 videos per run and then report on the top 5, but you can raise that as long as your YouTube API quota can handle the extra requests.

Is this YouTube trend automation automation better than using Zapier or Make?

For this specific job, n8n is usually the better fit because you need multi-step data collection (video stats plus channel stats), merging, custom scoring, sorting, and then an AI summary. That’s doable in Zapier or Make, but it tends to get expensive and fragile once you add branching and repeated API calls. n8n also gives you the self-host option, which matters if you run this frequently. If you only need a simple “search YouTube and email me links” workflow, the lighter tools can be fine. Talk to an automation expert if you want help choosing.

This is the kind of automation you set up once, then lean on every week. The workflow handles the collecting, scoring, and summarizing so you can focus on picking ideas that will actually land.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal