Running n8n in Production: Lessons from Dozens of Automation Deployments

n8n has become our primary workflow automation platform for client deployments. It's open-source, self-hostable, highly extensible, and capable of connecting to virtually any system via HTTP or its growing library of native integrations. But "getting started" guides and "running at scale" are very different conversations. Here's what we've learned.

Self-Host With Postgres, Not SQLite

n8n defaults to SQLite for storage, which is fine for local development and low-volume production. The moment you have dozens of active workflows, thousands of execution records, and concurrent workflow runs, SQLite becomes a bottleneck. Switch to PostgreSQL from the start — it's a two-line environment variable change during initial setup and nearly impossible to migrate cleanly afterwards without downtime.

Queue Mode for Reliability

By default, n8n runs workflows in "regular" mode, where the main process handles both the API and workflow execution. Under load, this creates contention. Queue mode separates the main process (handling the UI and webhooks) from worker processes (executing workflows), with Redis as the message broker. This enables horizontal scaling, better isolation of failures, and dramatically improved throughput. We deploy queue mode on every non-trivial production instance.

Execution Data Pruning Is Not Optional

Execution records accumulate fast. n8n stores the full input and output data for every node in every workflow execution. At a few thousand executions per day, your database will grow to tens of gigabytes within weeks. Configure EXECUTIONS_DATA_PRUNE=true and set a retention period that balances debugging needs against storage costs. We typically keep 30 days for high-volume workflows and 90 days for low-volume critical ones.

Error Handling as a First-Class Concern

Every workflow should have an Error Trigger workflow attached. When a workflow fails, the Error Trigger fires and can send a notification (Slack, email, PagerDuty), log structured failure data to your observability stack, and trigger a retry if appropriate. Running without error workflows is flying blind — you'll discover failures when users complain rather than before they do.

Version Control Your Workflows

n8n's Git integration allows you to push workflow definitions to a repository. Use it. Treat workflow changes like code changes: review them, version them, and deploy them through a controlled process. The "make a quick change in production" habit that feels harmless with a simple automation becomes catastrophic when it breaks a workflow that ten other systems depend on.

Share:
DL
Diona Leka
AI Practitioner & Writer at Vixus

Writing at the intersection of AI research and real-world enterprise deployment. Passionate about making AI accessible and genuinely useful.

Comments are powered by Disqus. Load comments