← All notes n8n · Content · Build log

One video in, thirty posts out: the n8n pipeline that runs while you sleep

Every creator I know has the same Tuesday problem. The video is done. Now the machine demands: three Shorts scripts, an X thread, a LinkedIn post, a carousel, a newsletter blurb. Same insight, five formats, zero additional brain cells available.

I automated it. Not with an app — with an architecture. This is the build log.

The four-layer architecture

Most people open n8n and start dragging nodes. That's how you get a fragile Rube Goldberg machine. Instead, separate concerns:

  1. Trigger layer — one schedule or webhook per source (YouTube Data API for new uploads, podcast RSS, blog RSS).
  2. State layer — the layer everyone skips. Store processed IDs in workflow static data so re-runs never touch old content.
  3. Agent layer — one LLM call per item, JSON-mode output, and a parse node that fails loudly when the model returns garbage instead of silently forwarding it.
  4. Queue layer — everything fans out to Google Sheets rows; Telegram gets a ping with counts. You review from your phone.

The idempotency lesson that saves your account

My first version reposted the same thread four times in one night. The fix is boring and non-negotiable:

// mark processed ONLY after the last node succeeds
const staticData = $getWorkflowStaticData('global');
staticData.processedIds = staticData.processedIds || [];
for (const item of $('Filter New Videos').all()) {
  staticData.processedIds.push(item.json.videoId);
}

Mark state at the end of the chain, never after generation. If the LLM call fails mid-run, the item stays unprocessed and retries cleanly. n8n only persists static data on successful executions, which gives you this behavior almost for free — if you order the nodes correctly.

Prompting details that actually mattered

Why queue-instead-of-autopost

Tempting to auto-publish everything. Don't. Platforms increasingly detect and suppress obvious bot patterns, and one bad AI-generated take can outrun your real voice. Drafts into a review queue keep the last mile human — which is also why the pack I sell ships as Sheets + Telegram notifications rather than direct posting.

Ship it in an hour: I packaged this exact architecture as AI Content Repurposing Engine — 12 production-ready n8n workflows covering YouTube→Shorts, podcast→social matrix, blog→carousel, comment triage, SEO rewriting, weekly growth reports and more. Idempotent by design, works with any OpenAI-compatible endpoint.