How I Built the Media Intake Engine: From Scattered Links to a Single Vault
Every team has the same mess: a link in Telegram, a playlist in Slack, a channel you meant to archive. Each one needs the same work. Here is how I made intake boring.

- 1webhook in
- 89workflow nodes
- 1,000videos per intake
- 18hscan lock window
Every team has the same mess. A YouTube link in Telegram, a playlist in Slack, a channel you meant to archive. Each needs the same work: pull metadata, get a transcript, dedupe, store, and confirm. By hand it costs a day. Left scattered, the asset is lost.
I built the Media Intake Engine to make intake boring. One webhook in, one vault out, whether the input is a single video or a whole channel. Here is how I built it so you can see the pattern and rebuild it.
Architecture at a glance
The engine runs on n8n on a small DigitalOcean droplet (2 vCPU, 4 GB, about $24 a month). Traffic flows through one TLS edge:
- CloudflareDNS + proxy
- TraefikTLS edge
- n8nprivate, internal only
Compose runs two services with restart: always on persistent volumes. Execution history is pruned after 72 hours or 5,000 runs, and long jobs get a 16-hour ceiling. SSH is private-network only. Management is private; the automation is public.
The pipeline comes in two flavors that share one discipline: dedupe early, paginate patiently, ack fast.
- Triggerwebhook
- n8norchestrator
- NCA Toolkitheavy lifting
- Object storageS3
- ResponseNotion / Telegram
Flavor A: generic media
n8n is the brain. Heavy lifting goes to the open-source No-Code Architects Toolkit, which pushes finished files to an S3-compatible bucket. The droplet holds only execution state.
Flavor B: this engine
A YouTube-specialized workflow of 89 nodes. It calls the YouTube Data API, Supadata for transcripts, and Notion. It never touches the toolkit or the bucket.
The shape is simple: one trigger, one vault, boring infrastructure.
Walkthrough
Trigger and normalize
A single webhook node receives every request.
0. Normalize Inputunwrapsbodyversus direct payloads so first entry and re-entry look identical.1.5 Is Batch?gates the acknowledgement: first entry sends an instant Telegram ack, batch re-entries restore context and skip it. That instant ack is why a 1,000-video intake never leaves the user hanging.Parse and route
2. Extract YouTube Infodetects?list=(playlist),/channel/,/c/and/@(channel), and plain video IDs.2.1 Route Input Typeswitches onvideo | playlist | channel.Expand playlists and channels
Channels resolve to their uploads playlist. Playlists page through at 50 items per request for up to 100 pages.
2.3d Plan Batchcaps a run at 1,000 videos (scanning up to 1,500), sorts oldest-first and dedupes. The loop checks each candidate: dupes wait 6 seconds, new videos re-enqueue to the workflow’s own webhook 25 seconds apart. A 180-second wait reconciles everything before the final count.Registry and scan lock
A registry database tracks
Scan In Progress. An 18-hour freshness window blocks duplicate scans and returns a busy notice on Telegram.Single-video dedup and transcript
Live streams are dropped. The vault is queried by YouTube ID where
Archive == false. Only new videos continue to5. Get Transcript (Supadata), where one GET request to Supadata’s/v1/transcriptendpoint returns the text, then on to final formatting. The full node setup is below.Vault, SOP and comments
The vault write creates the permanent Notion page. An AI agent (LangChain with Gemini Flash-Lite) drafts an SOP, written at 95 blocks per call with overflow patched in. Comments are fetched as 5 pages of 100 and chunked at 90 blocks. Thirteen Telegram nodes cover every human-facing outcome.
The Supadata transcript step
This is the part most people try to own and regret. Pulling captions from YouTube directly breaks every few months. I hand that job to Supadata and keep my own logic to routing and retries. One GET request, one header, four query parameters.
1. The request
| Setting | Value |
|---|---|
| Node | HTTP Request (v4.2), named 5. Get Transcript (Supadata) |
| Method and URL | GET https://api.supadata.ai/v1/transcript |
| Auth | Header Auth credential. Header name x-api-key, value is your key. The workflow only ever references the credential by name. |
url | Required. The full video URL, built from the video ID in the expression above. |
lang | Preferred language, ISO 639-1 (en). |
text | true returns one plain string. false returns timed chunks with offset and duration in milliseconds. |
mode | native (existing captions only, cheapest), generate (always AI), or auto (native, then AI). |
| Options | Full response on (so you can read the status code), Never Error on, 120 s timeout, retry 3 times 2 s apart. |
Two settings matter more than they look. Full response and Never Error let the next node branch on the HTTP status instead of the node failing, and Supadata uses status codes for real signals (202 and 206 below). And starting on mode=native keeps AI transcription, which costs 2 credits per minute, as a deliberate second step instead of a surprise.
2. Paste it into your instance
Copy this and paste it directly onto the n8n canvas. Replace <CREDENTIAL_ID> by selecting your own Header Auth credential, and make sure the incoming item has a videoId field.
{
"nodes": [
{
"name": "5. Get Transcript (Supadata)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.supadata.ai/v1/transcript",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "url",
"value": "={{ 'https://www.youtube.com/watch?v=' + $json.videoId }}"
},
{
"name": "lang",
"value": "en"
},
{
"name": "text",
"value": "true"
},
{
"name": "mode",
"value": "native"
}
]
},
"options": {
"response": {
"response": {
"fullResponse": true,
"neverError": true
}
},
"timeout": 120000
}
},
"credentials": {
"httpHeaderAuth": {
"id": "<CREDENTIAL_ID>",
"name": "supadataApi"
}
},
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 2000
}
],
"connections": {}
}
Built from Supadata’s documented API and n8n’s HTTP Request schema. Field names such as videoId follow this workflow, so rename them to match your own items.
3. What comes back
A normal answer is HTTP 200 with the text, the language you actually got, and every language available:
{
"statusCode": 200,
"body": {
"content": "Okay so today we are rebuilding the intake workflow from scratch. First thing, the webhook...",
"lang": "en",
"availableLangs": [
"en",
"es",
"de"
]
}
}
With text=false, content becomes an array of { text, offset, duration, lang } objects instead of one string. My map step handles both.
4. Mapping the response into the Notion vault page
A Code node (7. Format Final Data) flattens the response and prepares the Notion fields. Notion rich text caps at 2,000 characters per object, so the transcript is sliced at 1,900 and written as consecutive paragraph blocks.
// 7. Format Final Data (Code node, Run Once for Each Item)
const r = $json.body ?? $json; // Supadata payload
const text = Array.isArray(r.content) // text=false returns timed chunks
? r.content.map(c => c.text).join(' ')
: (r.content || '');
// Notion rich_text caps at 2,000 chars per object: slice at 1,900
const chunks = text.match(/[\s\S]{1,1900}/g) || [];
return {
json: {
ytId: $('4.1 Filter Valid Videos').item.json.videoId,
transcriptLang: r.lang,
availableLangs: (r.availableLangs || []).join(', '),
transcriptChars: text.length,
transcriptChunks: chunks, // one Notion paragraph block each
pipelineStatus: text ? 'Transcribed' : 'No speech detected'
}
};
| Supadata field | Becomes | Notion vault property |
|---|---|---|
content | transcriptChunks | Page body (paragraph blocks) |
lang | transcriptLang | Transcript Language (select) |
availableLangs | availableLangs | Available Languages (text) |
length of content | transcriptChars | Transcript Length (number) |
| empty or present | pipelineStatus | Pipeline Status (select) |
Property names above are the ones used in this walkthrough. Match them to your own database.
5. Supadata edge cases
A transcript API earns its fee on the ugly cases, because each one has a defined answer. A Switch node right after the request routes on the status code:
| Status | Meaning | Workflow action |
|---|---|---|
| 200 | content is present | Map and write to the vault |
| 202 | jobId returned | Poll /v1/transcript/{jobId} every second |
| 206 | transcript-unavailable | Retry once with mode=generate, or mark No captions |
| 403 / 404 | private, restricted or removed | Mark Inaccessible, no retry |
| 429 | rate or quota limit | Wait, then retry (node retry handles it) |
| 5xx | internal or upstream error | Retry 3 times, then the error workflow |
Videos without captions. In native mode Supadata answers HTTP 206 with a transcript-unavailable error. That request still costs 1 credit, so decide the policy once. For a research vault, retry that single video with mode=generate and accept the AI cost. For a cheap archive, write No captions to Pipeline Status and move on.
{
"error": "transcript-unavailable",
"message": "No transcript is available for this video",
"documentationUrl": "https://docs.supadata.ai/errors/transcript-unavailable"
}
Long videos and async job IDs. Anything over about 20 minutes that needs AI generation, and some shorter ones, comes back as HTTP 202 with only { "jobId": "..." }. Always handle 202, whatever the video length. Loop on this node, with a 1-second Wait between calls, until status is completed or failed. Results expire one hour after completion, so write them to the vault in the same run. Polling costs no credits. Put a hard cap on the loop (120 iterations is a sane ceiling) so a stuck job cannot hold a batch.
{
"nodes": [
{
"name": "5.2 Poll Supadata Job",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "=https://api.supadata.ai/v1/transcript/{{ $json.body.jobId }}",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"options": {
"response": {
"response": {
"neverError": true
}
}
}
},
"credentials": {
"httpHeaderAuth": {
"id": "<CREDENTIAL_ID>",
"name": "supadataApi"
}
}
}
],
"connections": {}
}
The finished job returns the same shape as an instant answer plus "status": "completed", so it feeds the same map step.
Language fallback. If the video has no transcript in your lang, Supadata returns the first available language and lists the rest in availableLangs. Compare lang to what you asked for. If you require a specific language and it appears in availableLangs, make a second call with that code. In generate mode lang is ignored and the transcript comes back in the video’s own language.
Other cases worth a branch. HTTP 200 with an empty content means no speech was detected (still billed by duration), so mark it rather than writing a blank page. Live streams are not supported, which is why 4.1 Filter Valid Videos drops them before this node. Private, members-only, age-restricted and heavily geoblocked videos return 403 or 404 and will never succeed, so do not retry them.
Credits in one line: a native transcript is 1 credit, AI generation is 2 credits per minute, and polling is free. Read the x-billable-requests response header if you want to log spend per video.
Error handling and retries
A global error workflow gives every failure a home. Node retries do the heavy lifting:
- Vault writes: 5 tries, 4 seconds apart.
- SOP creation: up to 8 tries, 8 seconds apart, where Notion rate limits bite.
- YouTube fetches: 3 tries, 2 seconds apart. Self-enqueue: 2 tries, 3 seconds apart.
- Partial success: six nodes use
continueRegularOutputso what worked still lands. - Waits are load-bearing: 25 s between enqueues, 6 s on dupes, 500 ms between comment chunks, 180 s before the final count.
For toolkit jobs longer than a minute, include a webhook_url in the request. Without it, Cloudflare’s one-minute timeout kills the response. With it, the toolkit calls you back.
All credentials are referenced by name only (YouTube OAuth, Supadata, Telegram, Notion, header auth for the toolkit, S3 for storage). No values are hardcoded or logged.
Prompts to rebuild it with an agentic coding system
Use an agent that can read your instance. Give it the pattern first, then the constraints. Run each prompt as its own turn so you can inspect the diff before layering more.
Rebuild a YouTube intake workflow in n8n behind Traefik.
Read docker-compose and env first. Create Media-Intake-Engine-V2 with
a single Webhook trigger. Implement Normalize Input, Is Batch? gate
with Telegram ack, Extract YouTube Info (regex for video/playlist/channel),
Route Switch, and per-video dedup against Notion DB <MEDIA_VAULT_ID>
where Archive is false. Reference credentials by name only. Dry-run
via n8n API before activating.Extend with batch orchestration: paginate playlistItems (50 per page,
100 pages), plan batch CAP 1000 oldest-first, loop SplitInBatches(1),
check each candidate, pace 6s on dupes and 25s between enqueues by
POSTing to <INTERNAL_N8N_URL>/webhook/<WEBHOOK_ID> with {batch:true}.
Add Registry DB <REGISTRY_ID> with Scan In Progress locking, 18h window,
busy notices via Telegram, 180s wait before final count.Add content rails: transcript via Supadata getTranscript with Pipeline
Status, write to Media Vault DB <MEDIA_VAULT_ID>. SOP via LangChain +
Gemini, parse to blocks, create page in SOP DB <SOP_DB_ID> at 95 blocks
and patch overflow. Comments fetch 5x100, chunk 90 blocks, pace 500ms.
Set retryOnFail (SOP 8x8s, vault 5x4s) and errorWorkflow. For non-YouTube
media, branch to NCA Toolkit POST /v1/media/transcribe and
/v1/media/convert/mp3 with X-API-Key, then POST /v1/s3/upload to storage.Why this ships
I treat automations like media: the backend system is the 80/20. A disposable brain (n8n), a cheap heavy-lifter (the toolkit at about $25 a month, plus about $5 for storage when you need it), and a durable ledger (Notion) behind one TLS edge. Each brick is replaceable. The pattern is not. Pacing stays explicit, credentials stay as references, and one Telegram thread tells the truth. Build it once, then feed it for months.
Get the data pipe
The transcript is the fuel. I run mine through Supadata, which handles the YouTube edge cases I do not want to own.
Disclosure: that is an affiliate link. I may earn a commission at no cost to you, and I only recommend what I run.

About the author
Christian Torres
Founder, Sun Vision Digital LLC
Direct response media buyer and builder of agentic systems. Las Vegas.
Christian writes direct response copy, buys media on Google and Meta, and builds agentic systems that watch the accounts he used to watch by hand. At his agency peak he ran 200+ Google and Meta Ads accounts. He trained in direct response in the Halbert, Carlton and Belcher lineage and holds 14 professional certifications.
- 14+years in digital marketing
- 200+ad accounts run at agency peak
- 9,000leads at a $4 cost per lead within four months
- 14professional certifications
Keep reading


