How to Build a 24/7 Autonomous AI Content & Traffic Pipeline (Open-Source Stack 2026)
Most "autonomous content pipelines" are a cron job wrapped around an LLM call and a prayer. They work for four days, then silently publish the same video twice, burn your API quota, and nobody notices until the analytics flatline. TL;DR: Wire n8n (orchestration + state) → short-video-maker (TTS, wo
Most "autonomous content pipelines" are a cron job wrapped around an LLM call and a prayer. They work for four days, then silently publish the same video twice, burn your API quota, and nobody notices until the analytics flatline.
TL;DR: Wire n8n (orchestration + state) → short-video-maker (TTS, word-level captions, Remotion render) → platform publish adapters, and use Claude Code in headless mode as the maintenance agent that repairs the pipeline instead of you. The hard parts aren't generation — they're idempotency, render throughput, and platform quotas.
The failure mode is never "the model wrote a bad script." It's structural:
Fix those four and the "AI" part is honestly the easy 20%.
cron 06:00 ──▶ ┌───────────────────────────────┐ │ n8n orchestrator (queue mode) │ └──────────────┬────────────────┘ │ 1. ingest: RSS / HN / sitemap / Reddit │ 2. dedupe: sha256(topic + angle + lang) ┌──────────────▼────────────────┐ │ Postgres state │ │ topics │ scripts │ renders │ posts │ metrics └──────────────┬────────────────┘ │ 3. script gen → strict JSON schema ┌──────────────▼────────────────┐ │ short-video-maker (MCP + REST)│ │ Kokoro TTS → whisper align │ │ → Pexels b-roll → Remotion │ └──────────────┬────────────────┘ │ mp4 + word timings ┌──────────────▼────────────────┐ │ publish adapters (rate-limited)│──▶ YT / TikTok / IG └──────────────┬────────────────┘ │ 4. pull metrics @ +24h / +72h ┌──────────────▼────────────────┐ │ topic scorer (bandit/UCB1) │──┐ └───────────────────────────────┘ │ back into step 1 ▼ Claude Code (headless, nightly) ──▶ reads failed executions, patches nodes/prompts, opens PR, smoke render Enter fullscreen mode Exit fullscreen mode Component breakdown:
# 1. State + orchestration docker network create pipeline docker run -d --name pg --network pipeline \ -e POSTGRES_PASSWORD = changeit -e POSTGRES_DB = pipeline \ -v pgdata:/var/lib/postgresql/data postgres:16 docker run -d --name n8n --network pipeline -p 5678:5678 \ -e DB_TYPE = postgresdb -e DB_POSTGRESDB_HOST = pg \ -e DB_POSTGRESDB_PASSWORD = changeit -e DB_POSTGRESDB_DATABASE = pipeline \ -e N8N_ENCRYPTION_KEY = "$(openssl rand -hex 24)" \ -e EXECUTIONS_DATA_PRUNE = true \ -v n8ndata:/home/node/.n8n docker.n8n.io/n8nio/n8n # 2. Render engine (check README for current image tags) docker run -d --name svm --network pipeline -p 3123:3123 \ -e PEXELS_API_KEY = "$PEXELS_API_KEY" \ gyoridavid/short-video-maker:latest-tiny Enter fullscreen mode Exit fullscreen mode Register it with Claude Code so you can iterate on scenes conversationally:
claude mcp add --transport http short-video-maker http://localhost:3123/mcp Enter fullscreen mode Exit fullscreen mode Or commit a project-scoped.mcp.json:
{ "mcpServers": { "short-video-maker": { "type": "http", "url": "http://localhost:3123/mcp" } } } Enter fullscreen mode Exit fullscreen mode Smoke-test the render contract before you touch n8n:
curl -sS -X POST http://localhost:3123/api/short-videos \ -H 'Content-Type: application/json' \ -d '{ "scenes": [ {"text": "Your n8n workflow is not idempotent.", "media": ["video"]}, {"text": "Here is the two-column fix.", "media": ["video"]} ], "config": {"paddingBack": 1500, "music": "chill"} }' | jq. Enter fullscreen mode Exit fullscreen mode Import community workflows, then audit them before enabling:
git clone --depth 1 https://github.com/enescingoz/awesome-n8n-templates docker exec -i n8n n8n import:workflow --separate --input=/tmp/templates/json Enter fullscreen mode Exit fullscreen mode Nightly maintenance agent, headless and scoped:
claude -p "Read last 24h of failed executions via the Postgres MCP tool. \ Identify the top failure class. Propose a minimal patch to workflows/ or prompts/. \ Do not deploy. Write findings to reports/$(date +%F).md" \ --allowedTools "Read,Grep,Edit,Bash(git diff:*)" \ --output-format json >> logs/agent.jsonl Enter fullscreen mode Exit fullscreen mode Add a PostToolUse hook in.claude/settings.json that runs npx tsc --noEmit and a one-scene smoke render on any edit under workflows/. Cheap guardrail, catches most regressions.
I publish one vetted repo per day — install notes, failure modes, and the config that actually worked — on VibeNode AI: t.me/vibenode_ai Search #Drop03 in the channel for this stack's ready-to-import n8n JSON and the Claude Code hook configs referenced above.
Question for the comments: where do you draw the line on agent autonomy in a production pipeline — is a nightly Claude Code PR that auto-merges on green CI acceptable, or does anything touching a publish endpoint need a human click? I've gone back and forth, and the answer seems to depend entirely on how reversible the side effect is.