web-intelligence · Off The Record
Self-Hosting N8N on Cloudflare Workers: A Real Guide
Self-Hosting N8N on Cloudflare Workers: A Real Guide
Every "AI automation expert" on LinkedIn will sell you their €97/month N8N hosting plan with a dashboard, support tickets, and a logo. I'm going to tell you how to run the same thing on infrastructure that costs less than your monthly Netflix subscription, and I'm not even going to ask you to subscribe to my newsletter first.Why self-host at all
Three reasons, and only one of them is about money. Data sovereignty — your automation data, your customer information, your API keys never leave servers you control. That matters a great deal once you're piping anything with compliance weight through a workflow, which is most workflows that actually generate revenue. Cost — N8N cloud pricing climbs with usage, and self-hosting flattens that curve to "the cost of a small VPS," full stop, regardless of how many workflows you run at 3am. And control — you decide the update schedule, the integrations, the uptime strategy, instead of waiting for a vendor's roadmap to catch up with what you actually need. The honest tradeoff: you own the uptime now. Nobody's paging a support team if it goes down. That's the deal.The actual setup
Cloudflare Workers themselves don't run N8N directly — N8N needs a persistent Node.js process, and Workers are stateless edge functions, which is a different animal entirely. What you're actually doing is running N8N on a small VPS or container service, then putting Cloudflare in front of it as the edge layer — reverse proxy, SSL, DDoS protection, and caching for anything that can be cached. Spin up a small instance — Hetzner, DigitalOcean, even a €5 Hostinger VPS handles low-to-medium volume N8N comfortably. Install N8N via Docker, which takes about four lines in a terminal and roughly the same amount of time it takes to read this sentence twice. Point a Cloudflare DNS record at the server, enable proxy mode (the orange cloud icon, the one everyone ignores until they understand what it does), and you've got Cloudflare's edge network sitting in front of your N8N instance, absorbing traffic spikes and handling SSL automatically. For webhook-heavy workflows — which is most of what N8N actually does in production — this setup means your webhooks resolve through Cloudflare's global edge before hitting your origin server. Faster, and your raw server IP stays hidden from anyone trying to hammer it directly.What this actually powers
This is the architecture underneath the Web Intelligence stack on this site, and partially behind News Beast itself — Cloudflare Workers handle the edge serving and API routing, while the heavier orchestration work runs on a self-hosted N8N instance sitting behind it. Different tools for different jobs. People assume "Cloudflare" means "everything runs on Workers," and it doesn't. Workers are extraordinary for stateless, fast, edge-first logic. N8N needs to maintain state, queue jobs, and run long workflows — wrong tool for a Worker, right tool for a small dedicated server with Cloudflare standing guard in front of it.The part everyone skips
Set up automated backups. I cannot stress this enough, because I learned it the expensive way — a workflow database with months of carefully tuned automation logic, gone, because nobody scheduled a backup cron job and a disk decided that Tuesday was the day to fail. N8N stores its workflow data in a database — SQLite by default, Postgres if you're running anything serious — and that database is the actual product. The server is replaceable. The workflows you built are not, unless you enjoy rebuilding three months of work from memory and bad documentation. A daily `pg_dump` or SQLite backup piped to cheap object storage costs pennies and saves you from the kind of afternoon nobody wants to have.What it costs, against what they're charging
A small VPS: roughly €5-10 a month. Cloudflare's free tier: zero, and it remains genuinely free for this use case, not a trial dressed up as generosity. Total: under €15 a month for infrastructure that handles serious automation volume. Compare that to managed N8N hosting plans that start around €50 and climb fast, or the "AI automation agency" charging you a four-figure retainer to manage a tool that took an afternoon to set up correctly. Somebody's making margin on your unwillingness to read a setup guide once. That somebody doesn't have to be your monthly budget.Want something like this built for your business?
Fractional CAIO
Tools used in this piece
Frequently Asked Questions
Who wrote this article?
This piece was written by Ilhan Irem Yuce , Founder of FreeMalta.com and Chief Editor of News Beast — Malta's first AI-native newsroom.
Is the architecture described here actually live?
Yes. Everything described is the real production system running News Beast on freemalta.com — not a conceptual demo.
How many AI writers does News Beast run?
Ten distinct author personas, each with a full character — biography, writing style, voice rules — covering twenty-two categories across Malta news, global affairs and lifestyle content.
What stops the AI writers from covering the same story?
A three-layer isolation system: separate RSS source pools per writer, non-overlapping keyword matching per category, and a seven-day URL blacklist that prevents the same source being reused across categories.
Can this architecture be used outside of news publishing?
Yes. The same pattern — isolated agent pools, structured character prompts, automated editorial review, never-empty fallback — applies to any business building AI agents for real production output, not just demos.