Content Automation Pipeline
A cloud-hosted n8n workflow that researches, writes, narrates, and files a day's content before 7 AM. Fully autonomous, and safe to fail.
- Personal engineering project. Designed, built, deployed, and operated end to end
- n8n · Railway · Google Gemini · 6 orchestrated APIs
- 2026 · Active, runs daily
- workflow nodes
- 15
- workflow nodes
- daily schedule trigger
- 6 AM
- daily schedule trigger
- saved every day
- ~2 hrs
- saved every day
- manual steps per run
- 0
- manual steps per run
The problem
Making short-form content every day was eating my mornings. Over an hour, every day, on the same sequence: search Reddit for trending topics, pick one, write a script, hunt for copyright-free footage, record audio, sort everything into folders.
Repetition on a fixed schedule is exactly what machines are for.
Motivation
Saving the hour was only half the point. I also wanted to learn workflow orchestration properly: how n8n composes services, and what it actually takes to run an unattended AI pipeline you can trust.
So I set a bar. It runs every morning whether or not my laptop is on. It never fails silently. And I can reconstruct any run from its logs.
Architecture
A schedule trigger fires at 6 AM and drives fifteen nodes: fetch trending Reddit topics, choose one, generate a script with Gemini Flash, clean the output, then hit a validation gate. A valid script flows on to Pexels for stock video, narration generation, Google Drive for storage, a log row in Google Sheets, and a summary email to me. An invalid script takes the failure branch instead: an error email, then a safe stop.
The whole thing runs on Railway using the official n8n template backed by PostgreSQL, so execution history survives redeploys and credentials live in managed environment variables. None of it depends on my hardware.
Scheduled + manual runs
6 AM cron trigger; on-demand execution when needed
Fails loudly, stops safely
Script validation gate → error email → clean stop
Assets filed automatically
Scripts, narration, and footage organised in Drive
Every run logged
Timestamp, execution ID, topic, status, errors → Sheets
Inbox observability
Success summaries and failure alerts by email
Cloud-native
Railway + PostgreSQL — runs with the laptop off
- Reddittrend discovery
- Geminiscript generation
- Pexelsstock footage
- Google Driveasset storage
- Google Sheetsexecution log
- Gmailsummaries & alerts
Engineering decisions
Validate before spending
The validation gate sits immediately after script generation, before any video downloads, narration, or storage. A malformed script stops the run at the cheapest possible point instead of producing a folder of garbage assets.
A cleaning stage between the model and everything else
Gemini's output varied in structure from run to run. A dedicated cleaning node standardises the script before downstream nodes touch it, so every later stage can assume one format. Never feed raw model output to machinery.
Cloud-hosted, not laptop-hosted
An automation that needs my laptop switched on isn't really autonomous. Hosting on Railway means the 6 AM run happens wherever I am, and PostgreSQL keeps the execution history through redeploys.
Observability built in from the start
Every run writes a row to Google Sheets with the timestamp, execution ID, chosen topic, status, and any errors. Between the success emails and the failure alerts, I never have to wonder whether it ran.
What was hard
Generated scripts varied a lot in structure and quality between runs.
Tightened the prompt and added the cleaning stage, so the variation gets absorbed before it can break anything downstream.
Narration sounded robotic rather than natural.
Tried different TTS providers and played with prompt formatting (pacing, punctuation, phrasing cues) until the voice was usable.
Results
The pipeline now runs every morning with zero manual steps. Scripts, narration, and stock footage get produced automatically, assets land organised in Google Drive, every execution is tracked in Sheets, and there's a summary email waiting when I wake up. That's roughly two hours back, daily.
The learning mattered as much as the hours. Chaining six APIs, prompt engineering for output a machine has to consume, and designing error handling for a system nobody is watching taught me more about automation than any tutorial could.
- Automatic YouTube uploads
- ElevenLabs narration
- CapCut automation
- Analytics dashboard
- Multiple content niches
An unattended system is only as good as its failure paths. What makes this one autonomous isn't the schedule trigger. It's the validation gate, the alerts, and the log.