
N8N v2 workflow automation with worker and external task runners for secure code execution

N8N v2 is a powerful workflow automation platform that helps you connect different services and automate tasks. This template includes:
This template uses external task runners - N8N's recommended production setup for executing code in Code nodes:
With N8N v2, you can:
The worker + task runner setup ensures your automation tasks are processed reliably and securely.
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true + queue mode, the main N8N instance never starts a task broker on port 5679 — all executions (manual and production) are offloaded to the Worker. N8N-Runners was permanently stuck on "Waiting for task broker to be ready" and served no purpose. Also removed the taskbroker port (5679) and N8N_RUNNERS_BROKER_LISTEN_ADDRESS from the N8N service. Only Worker-Runners remains (the Worker does run a broker).N8N_RUNNERS_TASK_BROKER_URI from http://Worker:5679 to http://${WORKER_BROKER_HOST}:5679. Zeabur's in-cluster DNS resolves service-<id> hostnames, not bare service names like Worker — runners were stuck on "Waiting for task broker to be ready" indefinitely, and Code nodes timed out after 60 seconds. The Worker service now exposes its internal hostname (WORKER_BROKER_HOST) via ${CONTAINER_HOSTNAME} for the runner to consume. (N8N_RUNNERS_ENABLED is deprecated in n8n v2 and intentionally not set — see docs.)N8N_PROTOCOL=https to both N8N and Worker. n8n builds $execution.resumeUrl from ${N8N_PROTOCOL}://${N8N_HOST}/...; without the protocol, the URL is malformed and every node (Set, Switch, Code, etc.) throws TypeError: Invalid URL.${ZEABUR_WEB_DOMAIN} / ${ZEABUR_WEB_URL} are unset in its container. Now consumes ${N8N_WEBHOOK_HOST} / ${N8N_WEBHOOK_URL} (newly exposed by the N8N service) for N8N_HOST and WEBHOOK_URL.postgres:18 — volume now mounts at /var/lib/postgresql for the new data-dir layout)TASK_RUNNERS_AUTH_TOKEN variable from the localized setup screens (the token is auto-generated and shared between services automatically)spec to service level), ensuring correct startup orderingN8N_RUNNERS_ENABLED environment variable (task runners are enabled by default in N8N v2)Runners into N8N-Runners (connects to http://N8N:5679) and Worker-Runners (connects to http://Worker:5679), matching the official n8n docker-compose setup where each n8n instance needs its own dedicated runnertask-runners service as a sidecar to n8n-workerN8N_RUNNERS_MODE=external for better security and performanceTASK_RUNNERS_AUTH_TOKEN variable for secure broker-runner authenticationThis update ensures your N8N v2 workflows run securely with external task runners, following N8N's best practices for production deployments.
N8N_ENCRYPTION_KEY for both main instance and workers⚠️ Important: If you're using a previous version of this template, please update to this version to avoid potential encryption key synchronization issues.
Note: This template enables critical environment variables to prevent future compatibility issues:
N8N_RUNNERS_MODE=external: Uses external task runner containers (recommended for production) instead of internal child processes.
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true: Running manual executions in the main instance in scaling mode is deprecated. Manual executions will be routed to workers in a future version. This setting prepares your deployment for this change.
Learn more about task runners: https://docs.n8n.io/hosting/configuration/task-runners/
This template has been logically designed and tested to work successfully. As a nocode user, I welcome any suggestions or improvements on GitHub. I'll do my best to update the template (with AI's help) since I'm not very familiar with GitHub.
If you encounter any issues during deployment, please let me know via GitHub issues: https://github.com/glasschan/seafoodholdhand-zeabur-templates