TechdomeVenture Studio
All Insights/n8n Automation

"Self-hosted n8n in production: queue mode, workers and Redis"

A production n8n setup splits one main process from scalable workers through Redis, stores data in PostgreSQL, and treats backups, secrets, monitoring and upgrades as real work.

Techdome Engineering
Techdome EngineeringEngineering Team
Oct 15, 20267 min read
Verified Architecture
"Self-hosted n8n in production: queue mode, workers and Redis"

A single n8n container is fine for a prototype. For production, run it in queue mode: one main process takes in triggers and serves the editor, Redis holds the queue of pending executions, and separate worker processes run the workflows. Pair that with a PostgreSQL database instead of the default SQLite file, and you have a setup that scales and survives restarts.

  1. 01Triggerwebhook or schedule
  2. 02Mainqueues the execution
  3. 03Redisholds the queue
  4. 04Workerruns the workflow
  5. 05PostgreSQLstores the results

The rest of this guide covers what each piece does and what you need around it.

Main process vs workers

In the default mode, one n8n process does everything: it listens for webhooks, fires schedules, serves the UI and runs every workflow. One heavy execution can slow the editor, and a crash can lose whatever was running. Queue mode splits those jobs.

ComponentRoleScale it by
Main instanceReceives triggers, serves editor and API, queues executionsKeep one, make it reliable
WorkersPull executions from the queue and run themAdding more, on several machines
Webhook processors (optional)Receive webhook traffic onlyAdding more for request bursts
RedisCarries the queue between main and workersManaged service or hardened container
PostgreSQLStores workflows, credentials and execution resultsStorage, backups, pruning

Long or CPU-heavy workflows no longer block incoming triggers, and capacity grows by adding workers.

Why Redis, and why not SQLite

Redis is the message broker between main and workers. It only carries the queue. Workflow definitions, credentials and execution results still live in the database, so Redis does not need to be treated like your system of record. It does need to be reachable by every n8n process: restrict network access to it and set a password.

Execution history grows quickly. Configure pruning so successful runs expire after a sensible window, and keep failed runs longer for debugging. Unbounded execution data is one of the most common reasons a self-hosted instance slows down over time.

Scaling workers

Start with a small number of workers and let measurements guide you.

  1. Watch queue depth. If jobs wait longer than your tolerance, add workers.
  2. Watch worker CPU and memory. Large files or big JSON payloads need more memory per worker.
  3. Tune concurrency per worker. Higher helps workflows that mostly wait on external APIs; lower protects workers doing heavy transformations.
  4. Respect downstream rate limits. More workers can mean more simultaneous calls to a throttled vendor API.

Secrets and credentials

n8n encrypts stored credentials with an encryption key. Every main and worker process must use the same key, or workers cannot decrypt credentials.

Other habits worth adopting:

  • Inject configuration through environment variables or a secrets manager rather than baking values into images.
  • Give each integration its own least-privilege credential instead of one broad key.
  • Limit who can create or edit credentials, and put the editor behind single sign-on or a VPN where you can.
  • Never log secrets from Code nodes.

Backups

Back up three things, and write down how to rebuild the environment (the Docker compose file, Terraform or equivalent) so recovery does not depend on one person's memory.

  • The database, with automated backups and a restore you test on a schedule
  • The encryption key, stored separately and securely
  • Workflows exported to version control, so changes are reviewable and an instance can be rebuilt from files
  • The environment definition, so the stack can be recreated

Monitoring and alerting

You cannot rely on someone noticing that a workflow stopped. Set up observability on three levels.

LevelWhat to watchAlert when
InfrastructureCPU, memory, disk on main, workers, Redis, databaseResources near limits
QueueDepth and age of the oldest waiting jobThe queue keeps growing
WorkflowsFailed executions and scheduled heartbeatsA run fails or is missing

Use n8n's error workflow feature so any failed execution sends an alert with the workflow name, the node and the error. Expose the health endpoints and metrics n8n provides to your monitoring stack.

Upgrades

Treat n8n upgrades like any application release.

  1. Read the release notes for breaking changes.
  2. Pin the version in your image tag. Avoid floating "latest" tags in production.
  3. Run the main instance and all workers on the same version.
  4. Back up the database, then test the upgrade in a staging copy with your real workflows.
  5. Upgrade, watch the queue and error alerts, and keep a rollback plan.

How this looks at Techdome

Techdome engineers production-grade self-hosted n8n workflows. Our automation sprints case study covers five rapid deployments on n8n Enterprise, with an average sprint of two to four days and a reported reliability of 99.9%. Our Irish pharmaceutical distribution case study combined n8n Enterprise with Docker and AWS for an automated SFTP order and invoice integration into a national wholesale ERP.

We do not publish the internals of any client cluster here. What we describe above is the general shape of a sound production setup. See the n8n and workflow automation page, or the DevOps and cloud page for the infrastructure side.

Takeaways

  • Use queue mode in production: a main process, Redis and one or more workers.
  • Use PostgreSQL, prune execution data, and test your restores.
  • Share one encryption key across all processes, and store and back it up as a top-tier secret.
  • Monitor the queue and wire error workflows to an alert someone owns.
  • Pin versions, stage upgrades and keep the main instance and workers aligned.

Have a project like this? Talk to our engineers.

FAQ

Questions readers ask

Do I need queue mode for a small team?

Not always. If workflows are light and an occasional restart is acceptable, a single instance with PostgreSQL can be enough. Move to queue mode when executions block each other or you need resilience.

Can I run n8n queue mode without Redis?

No. Queue mode relies on Redis to pass executions from the main process to workers.

What happens if a worker crashes mid-execution?

It depends on your configuration and on how the workflow is built. Design workflows to be idempotent and alert on failed or stalled executions so they can be retried safely.

Is SQLite ever acceptable in production?

For a single low-stakes instance it can run, but it cannot be shared by multiple processes and is harder to back up and scale. PostgreSQL is the safer default.

Continue reading

More foundry teardowns

View all
"n8n vs Zapier vs Make: which one for business automation"
n8n AutomationOct 15, 2026

"n8n vs Zapier vs Make: which one for business automation"

Techdome Engineering
Techdome EngineeringEngineering Team
"Automating mortgage back-office work with n8n"
n8n AutomationOct 15, 2026

"Automating mortgage back-office work with n8n"

Techdome Engineering
Techdome EngineeringEngineering Team
Production n8n Architecture: Hardened Patterns for Enterprise Pipelines
n8n AutomationAugust 2026

Production n8n Architecture: Hardened Patterns for Enterprise Pipelines

Rahul Joshi
Rahul JoshiChief Executive Officer
API testing explained: types, what to automate, and tools
Engineering PracticeOct 15, 2026

API testing explained: types, what to automate, and tools

Techdome Engineering
Techdome EngineeringEngineering Team
The DevOps lifecycle, from commit to production
Engineering PracticeOct 15, 2026

The DevOps lifecycle, from commit to production

Techdome Engineering
Techdome EngineeringEngineering Team
Fixed price vs time and materials for a software project
Engineering PracticeOct 15, 2026

Fixed price vs time and materials for a software project

Techdome Engineering
Techdome EngineeringEngineering Team
A practical HIPAA checklist for app architecture
Healthcare AIOct 15, 2026

A practical HIPAA checklist for app architecture

Techdome Engineering
Techdome EngineeringEngineering Team
How long does it take to build an MVP? A realistic timeline
Engineering PracticeOct 15, 2026

How long does it take to build an MVP? A realistic timeline

Techdome Engineering
Techdome EngineeringEngineering Team
"Multi-tenant SaaS on PostgreSQL: schema or row-level isolation"
System DesignOct 15, 2026

"Multi-tenant SaaS on PostgreSQL: schema or row-level isolation"

Techdome Engineering
Techdome EngineeringEngineering Team
"PCI DSS for startups: keep card data out of your systems"
Engineering PracticeOct 15, 2026

"PCI DSS for startups: keep card data out of your systems"

Techdome Engineering
Techdome EngineeringEngineering Team
Progressive web apps or native apps for clinical and field tools
System DesignOct 15, 2026

Progressive web apps or native apps for clinical and field tools

Techdome Engineering
Techdome EngineeringEngineering Team
RAG vs GraphRAG: when a knowledge graph is worth it
AI & Machine LearningOct 15, 2026

RAG vs GraphRAG: when a knowledge graph is worth it

Techdome Engineering
Techdome EngineeringEngineering Team
React or Next.js: what to choose for a new product
Our StackOct 15, 2026

React or Next.js: what to choose for a new product

Techdome Engineering
Techdome EngineeringEngineering Team
Staff augmentation vs dedicated team vs outsourcing
Engineering PracticeOct 15, 2026

Staff augmentation vs dedicated team vs outsourcing

Techdome Engineering
Techdome EngineeringEngineering Team
"Types of AI agents and when each one fits"
AI & Machine LearningOct 15, 2026

"Types of AI agents and when each one fits"

Techdome Engineering
Techdome EngineeringEngineering Team
"WCAG 2.2 AA: what to audit and how to test"
Engineering PracticeOct 15, 2026

"WCAG 2.2 AA: what to audit and how to test"

Techdome Engineering
Techdome EngineeringEngineering Team
+
+
+
+
System DesignOct 7, 2026

Vector Database Evolution: Production RAG Beyond Embeddings

Rahul Joshi
Rahul JoshiChief Executive Officer
Optimizing Next.js 15 Monorepos for Sub-Second TTFB at Scale
Studio ArchitectureSeptember 2026

Optimizing Next.js 15 Monorepos for Sub-Second TTFB at Scale

Rahul Joshi
Rahul JoshiChief Executive Officer
Autonomous Multi-Agent Orchestration: Production Patterns Beyond LangChain
Studio ArchitectureSeptember 2026

Autonomous Multi-Agent Orchestration: Production Patterns Beyond LangChain

Rahul Joshi
Rahul JoshiChief Executive Officer
Engineering Zero-Trust HIPAA Compliant AI Architectures for Telemedicine
Healthcare AIAugust 2026

Engineering Zero-Trust HIPAA Compliant AI Architectures for Telemedicine

Rahul Joshi
Rahul JoshiChief Executive Officer
The Techdome Blueprint: How We Build & Launch Software Ventures in 8 Weeks
Studio ArchitectureAugust 2026

The Techdome Blueprint: How We Build & Launch Software Ventures in 8 Weeks

Rahul Joshi
Rahul JoshiChief Executive Officer