How to Build an Automated YouTube Competitor Outlier & Script Research Agent (n8n + Apify)
The Verdict Up Front
An n8n + Apify agent that scrapes your niche's top channels weekly, flags any video beating its channel median by 3x or more, and turns the transcript into a hook/outline brief costs ~$30-$55/mo to run across 10 channels. Roughly half of that is Apify compute plus residential proxy bandwidth, not the LLM — the briefs themselves run ~$0.15 per run in LLM tokens, about $6.50/mo for 10 channels swept weekly.
n8n + Apify
Best for: Channel operators who want data-driven video ideas instead of guesses
A weekly n8n + Apify sweep of 10 competitor channels that flags videos at 3x+ the channel median and turns transcripts into hook/outline briefs. LLM tokens run ~$0.15 per run (~$6.50/mo); Apify compute and residential proxy bandwidth dominate the rest at ~$19-$35/mo.
Start with ApifyWhat This Builds
This blueprint is a nine-node n8n workflow that runs itself every Monday morning. It hands a list of competitor channels to an Apify YouTube Actor, pulls each channel's recent videos and view counts, computes the channel's median views, and flags every video that beats that median by 3x or more.
Tested & Verified: December 2026.
For each flagged outlier it fetches the transcript, sends it to an LLM to extract the hook, the promise, and a skeleton outline, and writes a structured brief you can script from. At 10 minutes of manual research saved per channel per week, that is about 7 hours/mo of analyst time returned — before you count the videos you stop guessing on.
- Channels tracked: 10
- Videos scanned per sweep: ~500 (~50 per channel)
- Outlier rule: views ≥ 3x the channel's median
- Transcripts fetched: flagged outliers only (~30 per sweep)
- LLM briefs: ~$0.15 per run x 10 runs/week x ~4.33 weeks = ~$6.50/mo
- Apify: Starter $19/mo + metered compute and proxy — lands ~$19-$35/mo
- n8n: 1 execution per channel = ~43 executions/mo; $6-$12/mo VPS self-hosted
- All-in: ~$30-$55/mo for the whole research loop
The Architecture
The pipeline is one n8n workflow with a weekly trigger. Two things dominate the bill: how many videos you scan (Apify bandwidth) and how many transcripts you summarise (LLM tokens). Everything else is a rounding error.
Node-by-node, this is what runs on each weekly sweep:
- Schedule Trigger: fires every Monday at 06:00 in your timezone.
- Set Channels: your list of competitor channel IDs or handles.
- Apify — Run YouTube Scraper: an HTTP node that starts an Apify Actor run against the channel list and returns recent video IDs, titles, and view counts.
- Code — Compute Medians: a Code node groups videos by channel and calculates each channel's median view count.
- IF — Outlier ≥ 3x Median: splits videos beating 3x the channel median from the rest; the rest are dropped.
- Apify — Fetch Transcript: a second Apify call (or the built-in caption endpoint) pulls the transcript for each flagged outlier only.
- LLM — Extract Hook & Outline: sends the transcript to a model with a strict JSON schema — hook, promise, three-beat outline.
- Set — Format Brief: normalises the model output into one brief per video.
- Postgres / Notion — Write Brief: stores the brief in your ideas database and pushes a Slack digest.
Per-Run Cost Math
Four meters bill this stack, and only two of them scale with your channel list. The Apify platform fee is flat; compute, proxy bandwidth, and LLM tokens scale with how many videos you scan and how many outliers you summarise.
| Meter | What it counts | At this volume | Scales how |
|---|---|---|---|
| Apify plan | Monthly platform fee | $19/mo (Starter, $17 annual) | Flat |
| Apify compute | Compute units (1 CU = 1 GB RAM x 1 hr) | ~2-4 CU per weekly sweep | $0.20 per CU |
| Apify residential proxy | GB scraped through headless Chrome | ~2-4 GB/mo | $8-$12 per GB |
| LLM briefs | Tokens per outlier transcript | ~43 runs/mo x $0.15 = ~$6.50 | Per run (~$0.15) |
| n8n | Executions (1 per channel) | ~43 executions/mo | $6-$12 VPS or Cloud from €20/mo |
Read the middle rows first: compute units and residential proxy bandwidth are two separate meters on the same Apify invoice, and the proxy line is the one that surprises people. A flat scraper API charges you per request; Apify charges you for the RAM-hour the headless Chrome browser occupies and every gigabyte it pulls through a residential IP. Scan more videos and both climb.
At 500 videos scanned a week, expect ~$19-$35/mo on Apify once usage is added to the Starter fee. The LLM side is stable at ~$6.50/mo because you only summarise the outliers — a well-tuned 3x filter keeps that list short. Add $6-$12/mo for a self-hosted n8n VPS and the whole loop lands at ~$30-$55/mo.
Step-by-Step Setup
- Create an Apify account and copy your API token. The free tier includes a $5/mo platform credit — enough to test one sweep, not to run the schedule.
- Pick a YouTube scraper Actor. The Apify Store has maintained YouTube scrapers that return video metadata and view counts; note the Actor ID and its input schema.
- Build the Schedule Trigger in n8n — one weekly run, Monday 06:00, so fresh ideas are waiting at the start of your week.
- Add the Set node with your competitor channel list. Keep it in one place so you can add a rival without touching the workflow logic.
- Wire the Apify HTTP node to start the Actor run against that list and return video IDs, titles, and view counts.
- Add the Code node that groups videos per channel and computes the median. Use the median, not the mean — one viral hit should not raise the bar for the whole channel.
- Add the IF node with a condition of
views >= median * 3so only genuine breakouts continue. - Fetch transcripts for the surviving videos through a second Apify call or the caption endpoint.
- Send each transcript to the LLM node with a JSON schema for hook, promise, and outline, then write the brief to Postgres or Notion.
Edge Cases & Error Handling
- Videos with no captions: auto-generated captions are missing on some uploads. Branch on an empty transcript and fall back to a description-only brief instead of failing the run.
- Channel median vs. mean: a single viral video skews the mean and hides the next breakout. Median first, then the 3x multiplier.
- Shorts vs. long-form: mixing Shorts and long-form views in one median distorts both. Split by content type before you compute the threshold.
- Anti-bot throttling: YouTube serves reduced or blocked responses to datacenter IPs. That is why the proxy meter exists — budget for residential bandwidth, not a bare HTTP fetch.
- Apify run failures: add a retry with exponential backoff and a dead-letter list so a single failed Actor run does not silently skip a channel all week.
- Rate limits: the LLM node should retry on 429s and cap concurrency so a burst of outliers does not trip provider limits.
Apify bills Compute Units ($0.20 each) and residential proxy bandwidth at $8-$12 per GB as separate meters. Headless Chrome loading YouTube pages across hundreds of videos is bandwidth-heavy, so the proxy line scales with how many videos you scan — not with how often the workflow runs. Scanning 2,000 videos/mo instead of 500 roughly quadruples the proxy bill while the n8n execution count barely moves.
Apify's free tier gives you a $5/mo platform credit. A weekly sweep of 10 channels scanning ~500 videos burns through that in a single run once compute and proxy bandwidth are counted. Treat the free tier as a proof-of-concept, not a schedule, and move to Starter at $19/mo before you turn the trigger on.
The bench for this build assumes 1 n8n execution per channel. That is fine at 10 channels, but a list that grows to 50 channels turns each weekly sweep into 50 executions, or roughly 217 executions/mo. On a capped Cloud plan that is the number to watch; self-hosting on a $6-$12/mo VPS removes the execution ceiling but adds the ops work.
The Blueprint
No pre-built download ships for this exact build, so the workflow is inline. Copy the JSON below into a file named workflow.json and use Import from File in the n8n editor.
{
"name": "YouTube Competitor Outlier & Script Research",
"nodes": [
{"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[1],"triggerAtHour":6}]}},"name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","typeVersion":1.2,"position":[220,300]},
{"parameters":{"assignments":{"assignments":[{"id":"channels","name":"channels","value":"["UC_x5XG1fL8Q","UCq-Fj5jknLsUfKk8Y_v1Bdw"]","type":"string"}]}},"name":"Set Channels","type":"n8n-nodes-base.set","typeVersion":3.4,"position":[440,300]},
{"parameters":{"method":"POST","url":"https://api.apify.com/v2/acts/apify~youtube-scraper/run-sync-get-dataset-items","sendQuery":true,"queryParameters":{"parameters":[{"name":"token","value":"{{ $credentials.apifyApiToken }}"}]},"sendBody":true,"specifyBody":"json","jsonBody":"={"startUrls":[{"url":"https://www.youtube.com/@{{ $json.channel }}"}],"maxResults":50}","options":{"timeout":300000}},"name":"Apify - Run YouTube Scraper","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[660,300]},
{"parameters":{"mode":"runOnceForAllItems","jsCode":"const byChannel = {};\nfor (const item of $input.all()) {\n const c = item.json.channel || 'unknown';\n (byChannel[c] ??= []).push(item.json);\n}\nconst out = [];\nfor (const [channel, vids] of Object.entries(byChannel)) {\n const views = vids.map(v => v.viewCount || 0).sort((a, b) => a - b);\n const mid = Math.floor(views.length / 2);\n const median = views.length % 2 ? views[mid] : (views[mid - 1] + views[mid]) / 2;\n for (const v of vids) out.push({ json: { ...v, channel, median, ratio: median ? v.viewCount / median : 0 } });\n}\nreturn out;"},"name":"Code - Compute Medians","type":"n8n-nodes-base.code","typeVersion":2,"position":[880,300]},
{"parameters":{"conditions":{"conditions":[{"leftValue":"={{ $json.ratio }}","rightValue":3,"operator":{"type":"number","operation":"gte"}}]}},"name":"IF - Outlier 3x Median","type":"n8n-nodes-base.if","typeVersion":2,"position":[1100,300]},
{"parameters":{"method":"POST","url":"https://api.apify.com/v2/acts/apify~youtube-transcript/run-sync-get-dataset-items","sendQuery":true,"queryParameters":{"parameters":[{"name":"token","value":"{{ $credentials.apifyApiToken }}"}]},"sendBody":true,"specifyBody":"json","jsonBody":"={"videoUrl":"{{ $json.url }}"}","options":{"timeout":120000}},"name":"Apify - Fetch Transcript","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[1320,220]},
{"parameters":{"method":"POST","url":"https://api.openai.com/v1/chat/completions","sendBody":true,"specifyBody":"json","jsonBody":"={"model":"gpt-4o-mini","response_format":{"type":"json_object"},"messages":[{"role":"system","content":"Extract hook, promise and a 3-beat outline as JSON keys hook, promise, outline."},{"role":"user","content":"{{ $json.transcript }}"}]}","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer {{ $credentials.openAiApiKey }}"}]}},"name":"LLM - Extract Hook & Outline","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[1540,220]},
{"parameters":{"assignments":{"assignments":[{"id":"brief","name":"brief","value":"={{ JSON.parse($json.choices[0].message.content) }}","type":"object"},{"id":"ratio","name":"outlierRatio","value":"={{ $('Code - Compute Medians').item.json.ratio }}","type":"number"}]}},"name":"Set - Format Brief","type":"n8n-nodes-base.set","typeVersion":3.4,"position":[1760,220]},
{"parameters":{"operation":"insert","schema":"public","table":"video_ideas"},"name":"Write Brief","type":"n8n-nodes-base.postgres","typeVersion":2.5,"position":[1980,220]}
],
"connections": {
"Schedule Trigger":{"main":[[{"node":"Set Channels","type":"main","index":0}]]},
"Set Channels":{"main":[[{"node":"Apify - Run YouTube Scraper","type":"main","index":0}]]},
"Apify - Run YouTube Scraper":{"main":[[{"node":"Code - Compute Medians","type":"main","index":0}]]},
"Code - Compute Medians":{"main":[[{"node":"IF - Outlier 3x Median","type":"main","index":0}]]},
"IF - Outlier 3x Median":{"main":[[{"node":"Apify - Fetch Transcript","type":"main","index":0}],[]]},
"Apify - Fetch Transcript":{"main":[[{"node":"LLM - Extract Hook & Outline","type":"main","index":0}]]},
"LLM - Extract Hook & Outline":{"main":[[{"node":"Set - Format Brief","type":"main","index":0}]]},
"Set - Format Brief":{"main":[[{"node":"Write Brief","type":"main","index":0}]]}
},
"settings": {"executionOrder":"v1"},
"active": false
}Prefer managed infrastructure? The same workflow runs on n8n Cloud without a VPS or the uptime work — the trade-off is the execution ceiling.
Starter $19/mo + $0.20 per compute unit; residential proxy billed $8-$12/GB · Affiliate link — we may earn a commission.
1 execution per channel — ~43/mo for a 10-channel list fits an entry Cloud plan · Affiliate link — we may earn a commission.
Related Reading
- n8n — the fair-code orchestration engine this blueprint runs on, self-hostable for the price of a VPS.
- Apify — the Actor marketplace and proxy layer that does the scraping, billed per compute unit plus proxy bandwidth.
- Firecrawl — an alternative scrape layer if you would rather pull channel pages as clean Markdown than run headless Chrome.
- Automated Faceless YouTube Production Pipeline: Storyboard, Voiceover & FFmpeg Assembly Cost — the production half of the same channel: this agent finds the idea, that pipeline ships it.
- Zapier vs Make vs n8n cost calculator — model the orchestration bill before you commit to a platform.
Frequently asked questions
Q: How much does this YouTube competitor research agent cost to run? About $30-$55/mo for 10 channels swept weekly. Apify lands at $19-$35/mo once compute units ($0.20 each) and residential proxy bandwidth ($8-$12/GB) are added to the $19 Starter fee, LLM briefs cost ~$6.50/mo, and a self-hosted n8n VPS runs $6-$12/mo.
Q: How does the agent decide which videos are outliers? It computes each channel's median view count and flags any video at 3x or more of that median. Median, not mean, so a single viral upload does not raise the bar for the whole channel and hide the next breakout.
Q: Do I need residential proxies for the Apify YouTube scrape? Effectively yes at any real volume. YouTube throttles datacenter IPs, so headless Chrome runs need residential bandwidth — billed separately at $8-$12 per GB on top of your Apify plan. That proxy line scales with how many videos you scan, not how often the workflow runs.
Q: Can I run this on free Apify credit or the free n8n tier? Only to test. Apify's free tier is a $5/mo platform credit that one weekly sweep of 10 channels burns through once compute and proxy bandwidth are counted. n8n self-hosted is free but needs a $6-$12/mo VPS; Cloud plans cap executions, and 1 execution per channel adds up as your list grows.
Q: How many n8n executions does one weekly run use? One execution per channel. A 10-channel list is 10 executions per sweep, or about 43/mo. A 50-channel list is 50 executions per sweep — roughly 217/mo — which is the number to check against a Cloud plan's cap.
Q: What happens if a competitor video has no captions? Auto-generated captions are missing on some uploads, so branch on an empty transcript and fall back to a title-and-description brief rather than failing the run. Never let one uncaptioned video drop the whole sweep.
Written by
Marcus ChenLead Automation Architect
Marcus builds and benchmarks AI operations workflows for e-commerce and agency teams. He previously ran a 12-person ops team and has shipped 400+ production Make and n8n scenarios.