n8n v2.0 Migration — Automated Task Runner Setup

n8n Docker Automation

Description

Built a reproducible n8n v2 migration with Docker that automates task-runner configuration — no manual container edits, survives restarts and upgrades.


Why I built this (n8n v2 + Task Runners)

When I moved my self-hosted n8n setup to v2 with external Task Runners, I didn’t want a migration that only works once. I wanted something I can redeploy later (or upgrade) and still get the same result.

What was annoying about the usual fixes

Most of the community solutions I came across were basically: “go into the container and edit files / run sed manually”. That works, but it’s fragile—after an update or redeploy you often have to redo the same steps again.

What I did instead

I automated the runner configuration so it’s applied on every deploy:

  • A small one‑shot helper container (n8n-config-patcher) generates/patches n8n-task-runners.json during deployment.
  • The patched file is stored on the host and mounted read‑only into n8n-runners.
  • The patch makes sure the relevant allowlist-related environment keys are actually accepted by the runner config, so the runner gets the intended settings reliably.

Outcome

A cleaner migration: no manual container edits, and the configuration survives restarts and upgrades.

Warum ich das gebaut habe (n8n v2 + Task Runners)

Als ich mein selbst gehostetes n8n-Setup auf v2 mit externen Task Runnern umgestellt habe, wollte ich keine Migration, die nur einmal funktioniert. Ich wollte etwas, das ich später erneut deployen (oder upgraden) kann und trotzdem das gleiche Ergebnis erhalte.

Was an den üblichen Lösungen nervig war

Die meisten Community-Lösungen liefen darauf hinaus: „Geh in den Container und bearbeite Dateien / führe sed manuell aus.” Das funktioniert, aber es ist fragil — nach einem Update oder Redeploy muss man oft die gleichen Schritte wiederholen.

Was ich stattdessen gemacht habe

Ich habe die Runner-Konfiguration automatisiert, sodass sie bei jedem Deploy angewendet wird:

  • Ein kleiner Einmal-Hilfscontainer (n8n-config-patcher) erzeugt/patcht n8n-task-runners.json während des Deployments.
  • Die gepatchte Datei wird auf dem Host gespeichert und read-only in n8n-runners gemountet.
  • Der Patch stellt sicher, dass die relevanten Allowlist-Umgebungsvariablen tatsächlich von der Runner-Konfiguration akzeptiert werden.

Ergebnis

Eine saubere Migration: keine manuellen Container-Änderungen, und die Konfiguration übersteht Neustarts und Upgrades.