Enterprise-grade N8N Queue Mode deployment template with multi-worker scalability, optimized for Kubernetes and self-hosted environments.
- Queue Mode Architecture: Distributed job processing with multiple workers
- Kubernetes Ready: Production-ready Helm charts and manifests included
- Auto-Scaling: Horizontal pod autoscaling based on queue depth
- High Availability: Redis-backed queue with failover support
- Docker Optimized: Minimal images with multi-stage builds
- Infrastructure as Code: Complete IaC setup for rapid deployment
- Multi-Environment Support: Dev, staging, and production configurations
- Docker & Docker Compose (for local development)
- Kubernetes 1.24+ (for production deployment)
- Helm 3.x (for K8s deployment)
- Redis (for queue backend)
- PostgreSQL 12+ (for N8N database)
# Clone and setup
git clone <repository-url>
cd n8n-queue-instance
# Start with docker-compose
docker-compose -f docker/docker-compose.dev.yml up -d
# Access N8N
# UI: http://localhost:5678
# API: http://localhost:5678/api# Install using Helm
helm repo add n8n-queue ./kubernetes/helm
helm repo update
# Deploy to cluster
helm install n8n-queue n8n-queue/chart \
--namespace n8n \
--values kubernetes/values-prod.yaml.
├── docker/ # Docker build files and compose configs
│ ├── Dockerfile # Multi-stage N8N image build
│ ├── docker-compose.dev.yml
│ ├── docker-compose.prod.yml
│ └── .dockerignore
├── kubernetes/ # K8s manifests and Helm charts
│ ├── helm/ # Helm chart for deployments
│ ├── manifests/ # Raw K8s YAML files
│ ├── kustomize/ # Kustomize overlays (dev/staging/prod)
│ └── values-*.yaml # Environment-specific values
├── config/ # Configuration templates
│ ├── .env.example # Environment variables template
│ ├── n8n.json # N8N configuration
│ └── redis.conf # Redis configuration
├── scripts/ # Deployment and utility scripts
│ ├── deploy.sh # Deployment automation
│ ├── scale.sh # Worker scaling script
│ └── health-check.sh # Health verification
├── docs/ # Documentation
│ ├── ARCHITECTURE.md
│ ├── DEPLOYMENT.md
│ ├── TROUBLESHOOTING.md
│ └── SCALING.md
└── .github/workflows/ # CI/CD pipelines
├── build.yml # Docker image build
├── deploy.yml # Automated deployment
└── tests.yml # Test suite
Copy .env.example to .env and update values:
# Core
N8N_PORT=5678
N8N_PROTOCOL=https
N8N_HOST=your-domain.com
N8N_EDITOR_BASE_URL=https://your-domain.com/
# Database
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgres
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=secure_password
# Queue
QUEUE_MODE_ACTIVE=true
QUEUE_BULL_REDIS_HOST=redis
QUEUE_BULL_REDIS_PORT=6379
# Workers
N8N_WORKER_COUNT=3
N8N_WORKER_MEMORY_LIMIT=2048Edit config/n8n.json for queue-specific settings:
{
"queue": {
"mode": "bull",
"redis": {
"host": "redis",
"port": 6379,
"db": 0,
"maxRetriesPerRequest": null,
"enableReadyCheck": false
},
"bull": {
"concurrency": 1,
"lockDuration": 30000,
"lockRenewTime": 15000
}
}
}cd docker
docker-compose -f docker-compose.dev.yml up -dSee DEPLOYMENT.md for detailed instructions.
./scripts/scale.sh --workers 5 --namespace production./scripts/health-check.sh# Docker
docker-compose logs -f n8n-main
docker-compose logs -f n8n-worker
# Kubernetes
kubectl logs -n n8n -l app=n8n-main -f
kubectl logs -n n8n -l app=n8n-worker -fAccess Prometheus metrics at: http://localhost:9090
This template includes HA configuration with:
- Redis Sentinel for database failover
- PostgreSQL replication (optional)
- Multiple N8N main instances
- Distributed worker pool
- Load balancing with Nginx/HAProxy
See ARCHITECTURE.md for detailed HA setup.
- API authentication required
- TLS/SSL support included
- Secret management via K8s secrets or Vault
- RBAC policies included
- Network policies for pod isolation
Common issues and solutions in TROUBLESHOOTING.md
- Create a branch:
git checkout -b feature/your-feature - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature/your-feature - Submit a pull request
- Issues: GitHub Issues
- Documentation:
/docsfolder - Community: N8N Community Forum
Proprietary - Dimoss Organization
- Current: 1.0.0
- N8N Version: Latest
- Last Updated: November 2025