logo
icon

N8N v2 with Worker & Task Runners

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

template cover
Implementado402 veces
Editorglasschan
Creado2025-03-04
Servicios
service icon
service icon
service icon
service icon
service icon
Etiquetas
AutomationWorkflowN8N v2Task RunnersCode Execution

N8N v2 with Worker & Task Runners (create by SEAFOODHOLDHAND)

N8N with Worker

N8N v2 is a powerful workflow automation platform that helps you connect different services and automate tasks. This template includes:

  • N8N v2 main instance for workflow management (latest version)
  • N8N worker for processing background tasks
  • External Task Runners for secure Code node execution (production-ready setup)
  • PostgreSQL database for data storage
  • Redis for queue management

Why External Task Runners?

This template uses external task runners - N8N's recommended production setup for executing code in Code nodes:

  • 🔒 Enhanced Security: Code runs in isolated containers, separate from your main N8N instance
  • ⚡ Better Performance: Task runners can scale independently based on workload
  • 🛡️ Sandboxed Execution: JavaScript and Python code execute in controlled environments
  • 🔄 Auto-Shutdown: Idle runners automatically shut down after 15 seconds to save resources
  • 📊 Production Ready: Follows N8N's best practices for production deployments

With N8N v2, you can:

  • Create automated workflows with the visual editor
  • Connect to hundreds of services and APIs
  • Execute custom JavaScript and Python code securely in Code nodes
  • Process data and automate tasks with reliable background workers
  • Handle webhook-triggered workflows efficiently

The worker + task runner setup ensures your automation tasks are processed reliably and securely.

Update Log

2025-12-28

  • IMPORTANT: Template updated for N8N v2 compatibility
  • Upgraded to external task runners (production-recommended setup)
  • Added separate task-runners service as a sidecar to n8n-worker
  • Configured N8N_RUNNERS_MODE=external for better security and performance
  • Task runners now execute Code node JavaScript/Python code in isolated containers
  • Added TASK_RUNNERS_AUTH_TOKEN variable for secure broker-runner authentication

This update ensures your N8N v2 workflows run securely with external task runners, following N8N's best practices for production deployments.

2025-03-17

  • Fixed N8N_ENCRYPTION_KEY mismatch between n8n main instance and worker
  • Ensured worker uses the same encryption key as main instance for improved system stability
  • Added ability to manually set 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 two critical environment variables to prevent future compatibility issues:

  • N8N_RUNNERS_ENABLED=true: Enables task runners for executing Code node code securely. Task runners are required for JavaScript and Python code execution in Code nodes.

  • 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