See llms.txt for all machine-readable content.

Back to Templates

Send weekly YouTube Shorts breakout trend reports with OpenAI and Gmail

Quick overview

This workflow runs every Monday and uses the YouTube Data API to find high-performing Shorts across multiple search queries, then uses OpenAI to write a weekly Markdown trend report that is converted to HTML and sent to you via Gmail.

How it works

  1. Runs every Monday at 07:00.
  2. Splits a configurable list of search queries and calls the YouTube Data API Search endpoint to fetch the most viewed Shorts published in the last N days for each query.
  3. Fetches video details from the YouTube Data API, normalizes fields like views, duration, and age, and filters to “real” Shorts up to 180 seconds.
  4. Looks up channel statistics from the YouTube Data API (batched by channel IDs) to get subscriber counts and channel metadata.
  5. Compiles a trend brief that summarizes results per query and identifies “breakouts” (high views on low-subscriber channels) with example Shorts links and metrics.
  6. Sends the brief to OpenAI to generate a structured weekly trend report in Markdown.
  7. Converts the Markdown report to HTML and emails it to the configured recipient using Gmail.

Setup

  1. Create a YouTube Data API v3 key and add it to n8n as an HTTP Query Auth credential, then select it for the YouTube API requests.
  2. Add an OpenAI credential (or replace the model node with another supported chat model) for generating the report.
  3. Connect a Gmail account credential and confirm the recipient email address in the workflow settings.
  4. Update the scout settings (queries, lookback days, region, language, and breakout thresholds) and ensure the schedule time matches your preferred timezone.