All case studies
[ REFERENCE ARCHITECTURE ]High-availability automation infrastructure

Run n8n like production infrastructure, not a single container.

Out of the box, n8n is one container doing the UI, the API, the triggers, and the execution, so one crash means your automations stop. This is my reference architecture for running it highly-available and self-healing on AWS.

Reference architecture (RTO/RPO below are design targets, not measured production numbers).

Multi-AZ
across 2 zones
Queue mode
main + workers
5–10 min*
RTO · single-AZ*
0*
RPO*
Zero-downtime
rolling upgrades

* design targets for this reference architecture

resilient-n8n · aws
self-healing
Application Load Balancer
HTTPS · health-checked
public entry
ECS Fargate · queue mode
failed tasks auto-replaced
AZ-a
main ×n
web · API · triggers
worker ×n
execution
AZ-b
main ×n
web · API · triggers
worker ×n
execution
durable state
RDS Postgres
Multi-AZ
EFS
shared · encrypted
DR & delivery
AWS Backup
+ cross-region DR · snapshot export
OIDC CI/CD
approval-gated · no static keys
self-healing
health checks + deploy circuit-breaker auto-rollback
100% Terraform, reproducible in any account/regionreference architecture
The problem

n8n's default deployment is a single point of failure: one process runs the UI, the API, the triggers, and the workflow execution. A crash or a lost host means downtime, and in-flight executions can be interrupted or lost. A single node can't absorb spikes, upgrades are risky, and there's no real disaster-recovery story.

Default deployment
n8n (all-in-one)
UIAPItriggersexecution
one crash → all down
single point of failure
What I built

n8n in queue mode on ECS Fargate: the main (web/API) service and the worker service separated and scaled independently, run in at least two availability zones behind an Application Load Balancer. Health checks drain and replace failed tasks automatically; a Multi-AZ Postgres and a shared encrypted filesystem keep state durable; autoscaling tracks CPU and memory; a deployment circuit-breaker auto-rolls-back a bad release; tiered backups plus cross-region export cover disaster recovery; and a workers-first rolling pipeline ships new n8n versions with zero downtime. All of it is Terraform, deployed through OIDC CI/CD with no static keys.

Resilient topology
self-healing
  • Multi-AZ
  • queue mode
  • auto-heal
  • auto-rollback
  • DR
The outcome: design targets

The design targets: no single point of failure, failed tasks replaced automatically, executions kept durable through queue mode + Postgres, and a documented recovery path for every failure mode, from a single-AZ blip (RTO 5–10 min, RPO 0) up to a full region loss. Version upgrades ship with zero downtime, and every deploy is one approval-gated, fully-reproducible pipeline run.

Recovery targets* · by failure mode
Single-AZ5–10 min* · RPO 0*
DB restore30–60 min*
Region loss2–4 h*

* design targets for this reference architecture

[ reference architecture · RTO/RPO are design targets, not measured production numbers ]

[ CAPABILITIES ]What the architecture delivers

What the architecture gives you.

Six properties this reference architecture is designed for, every one of them defined in Terraform.

Queue mode

The main (web/API) service and the worker service run as independent services, separated so each scales on its own.

independent main + worker services

Multi-AZ + self-healing

Tasks run across at least two availability zones; health checks replace any unhealthy task automatically.

≥2 AZs · health-checked auto-replacement

Tiered backups + cross-region DR

Daily, weekly, and monthly backups, plus snapshot export to a second region for disaster recovery.

daily / weekly / monthly + snapshot export

Zero-downtime upgrades

A workers-first rolling deploy ships new n8n versions without downtime, with automatic rollback on failure.

workers-first rolling deploy + auto-rollback

OIDC CI/CD

Every deploy runs through an approval-gated pipeline that authenticates with OIDC. No long-lived cloud keys stored anywhere.

approval-gated · no stored cloud keys

Defense-in-depth

Scoped security groups, private subnets, vaulted secrets, and encryption at rest and in transit. Layered, not bolted on.

encrypted at rest + in transit
[ UNDER THE HOOD ]How it holds up

Designed to heal itself before anyone gets paged.

The parts that keep n8n up when a task, a zone, or a release goes wrong.

Self-healing

  • ALB and container health checks drain and replace unhealthy tasks automatically.
  • A deployment circuit-breaker rolls back failed releases automatically.

Safe upgrades

  • Detects the latest n8n version, then updates workers first and main second.
  • Waits for the service to reach stable before the rollout completes.

Durable by design

  • Multi-AZ Postgres and a shared encrypted EFS keep state off the tasks.
  • Any task can be replaced without losing workflows or executions.

Reproducible

  • 5 Terraform modules, ~65 AWS resources, three sized environments.
  • State is locked and encrypted: stand it up in any account or region.
2 AZs·queue mode·~65 AWS resources·5 TF modules·auto-rollback·RTO 5–10 min*

* design targets for this reference architecture

[ Let's build yours ]

Your automations shouldn't have a single point of failure.

Tell me what you're automating and where it runs today. I'll map out the highly-available version: main and workers split across zones, health-checked recovery, and the whole thing reproducible in Terraform.