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
- Runs every Monday at 07:00.
- 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.
- Fetches video details from the YouTube Data API, normalizes fields like views, duration, and age, and filters to “real” Shorts up to 180 seconds.
- Looks up channel statistics from the YouTube Data API (batched by channel IDs) to get subscriber counts and channel metadata.
- Compiles a trend brief that summarizes results per query and identifies “breakouts” (high views on low-subscriber channels) with example Shorts links and metrics.
- Sends the brief to OpenAI to generate a structured weekly trend report in Markdown.
- Converts the Markdown report to HTML and emails it to the configured recipient using Gmail.
Setup
- 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.
- Add an OpenAI credential (or replace the model node with another supported chat model) for generating the report.
- Connect a Gmail account credential and confirm the recipient email address in the workflow settings.
- Update the scout settings (queries, lookback days, region, language, and breakout thresholds) and ensure the schedule time matches your preferred timezone.