← BlogAI Automation

n8n 2.0 Migration Guide: Task Runners, Code Node Breaking Changes and the Pre-Upgrade Checklist

By Aditya JhaNovember 21, 20269 min read

n8n 2.0 Migration Guide: Task Runners, Code Node Breaking Changes and the Pre-Upgrade Checklist

A COO in Sydney bumps the n8n image tag on a Friday afternoon because a security advisory said to. By Monday, the lead-scoring workflow that feeds the sales team has been silently erroring: a Code node reads an API key from `$env`, and it now returns nothing. Nothing was wrong with the workflow. The platform changed its defaults. n8n 2.0 is a hardening release: it moves code execution into isolated task runners, locks down environment access, and removes several legacy components. This guide covers what changes, why each change exists, and the order in which to fix a self-hosted instance before you upgrade, with particular attention to workflows that run AI agents.

What actually breaks when you upgrade to n8n 2.0?

Five areas break most often: Code node execution, environment variable access, the Python Code node, database support, and a few removed nodes. Per n8n's official breaking-changes page, task runners are now enabled by default and all Code node executions run on them, `N8N_BLOCK_ENV_ACCESS_IN_NODE` now defaults to `true`, the Pyodide-based Python Code node is removed, and MySQL and MariaDB are no longer supported as storage backends.

The common thread is isolation. Before 2.0, a Code node ran inside the main n8n process, with access to its environment and the host. That is convenient and also the shape of most recent n8n remote code execution advisories. Moving user code to a separate runner process contains the blast radius when an expression or snippet misbehaves, which matters more when workflows execute LLM-generated or user-supplied content.

What are task runners, and should you use external mode?

A task runner is a separate process that executes your Code node JavaScript (and Python) so it does not share memory or environment with the n8n main process. In the default internal mode n8n launches the runner for you. In external mode you run it as its own container, and the page recommends this for extra security.

One packaging detail trips up Docker users: the `n8nio/n8n` image no longer includes the task runner for external mode. You must use the separate `n8nio/runners` image. If you run queue mode, plan one runner per worker so Code node throughput scales with your worker count rather than bottlenecking on a single sidecar.

Test before you commit. n8n documents that you can set `N8N_RUNNERS_ENABLED=true` on your current 1.x version to see how your Code nodes behave under runners ahead of the upgrade. That one flag turns the migration from a surprise into a staging exercise.

Why does my Code node suddenly return nothing from $env?

Because `N8N_BLOCK_ENV_ACCESS_IN_NODE` now defaults to `true`, so Code nodes can no longer read environment variables. You can set it to `false` to restore the old behaviour, but the better fix is to stop putting secrets in environment variables that code can read.

Move API keys and tokens into n8n credentials and reference them through the nodes that need them. This is the same principle as least-privilege tool permissions for AI agents: a snippet that only needs to reshape JSON should not be able to see your OpenAI key. If an agent workflow lets a model write or select code, this default is a real protection, not an annoyance.

A related change: `$evaluateExpression()` no longer works inside the Code node because secure mode disables evaluating strings as code. Expressions in ordinary node fields are unaffected. The documented migration paths, in order of preference, are to write the logic directly in JavaScript, or evaluate the expression in an Edit Fields (Set) node before the Code node. `N8N_RUNNERS_INSECURE_MODE=true` exists but the docs discourage it as a temporary workaround.

What happens to Python Code nodes in n8n 2.0?

The Pyodide-based Python Code node and tool are removed. Python now works only through task runners in external mode, plus native Python tools. The native Python runtime has no `_input` variable and no dot-access notation, so existing Python snippets need to be reviewed rather than assumed to carry over.

For teams that used Python Code nodes for light data cleaning in agent pipelines, the practical choices are to port the snippet to JavaScript, or stand up an external runner with a Python environment. Choose by volume: a handful of small transforms is faster to port; a library-heavy pipeline justifies the runner.

Which other defaults changed that can break AI agent workflows?

  • **Database:** MySQL and MariaDB are no longer supported as n8n's own storage. Migrate to PostgreSQL (or SQLite) with n8n's database migration tool before upgrading. The MySQL node for your business data is unaffected.
  • **Binary data:** the in-memory `default` mode is removed. Options are `filesystem` (default in regular mode), `database` (default in queue mode) and `s3`. If your agents pass PDFs or images between steps, check disk space.
  • **Disabled nodes:** Execute Command and Local File Trigger are disabled by default; re-enable via `NODES_EXCLUDE` only if you genuinely need them.
  • **Start node removed:** replace it with a Manual Trigger, or an Execute Workflow Trigger for sub-workflows.
  • **Sub-workflow output:** when a child workflow pauses (a Wait over 65 seconds, a webhook, a form or a human-in-the-loop approval), the parent now receives the child's final output instead of its input. Review any parent that branches on that value.
  • **OAuth:** `N8N_SKIP_AUTH_ON_OAUTH_CALLBACK` changes from `true` to `false`. Set it to `false` first and retest your OAuth integrations.
  • **Queue mode:** `QUEUE_WORKER_MAX_STALLED_COUNT` is removed and stalled jobs are no longer retried automatically, so make steps with side effects idempotent.

What is the safest order to upgrade a production n8n instance?

Upgrade a staging copy first, fix what breaks, and only then touch production, with a pinned version tag. The `latest` and `next` tags are renamed `stable` and `beta`, and the page recommends pinning an explicit version such as `2.0.0` instead of floating.

A sequence that works: (1) export all workflows and credentials and keep the database backup; (2) if you are on MySQL or MariaDB, migrate to PostgreSQL; (3) on 1.x, set `N8N_RUNNERS_ENABLED=true` and run your Code-node-heavy workflows; (4) grep exported workflow JSON for `$env`, `$evaluateExpression`, Python Code nodes, Start nodes and Execute Command; (5) move secrets to credentials; (6) set `N8N_SKIP_AUTH_ON_OAUTH_CALLBACK=false` and retest OAuth; (7) upgrade staging, replay a week of real inputs, compare outputs; (8) schedule production during a low-traffic window with a rollback image ready.

Treat step 4 as the one that earns its keep. Most 2.0 breakage is not a crash, it is a Code node returning an empty value, which a workflow happily passes downstream. Put a silent-failure alert on your error workflow before the upgrade, and keep workflows in version control so a rollback is a diff, not a memory.

How AIBOOTSTRAPPER helps

We do not have a published client case study where an n8n 2.0 migration was the headline result, so we will not invent one. What we can say honestly is how we run these upgrades for clients: inventory every workflow for the breaking patterns above, move secrets into credentials, rehearse on staging with replayed production inputs, and ship with monitoring so an empty Code node output pages someone instead of reaching a customer. Our approach to production-grade delivery is visible across the case studies, including document-heavy AI systems where silent errors are costly.

If you run self-hosted n8n and an upgrade is on your calendar, talk to us. Our AI automation team works to international standards with India-based economics, and a pre-upgrade audit of your workflows is a short, well-scoped engagement.

Want this done for you?

Book a free strategy call and we'll show you how to build and market your business with AI.

Sources and further reading

  1. 1.n8n Docs: v2.0 breaking changes
FAQ

Questions, answered

Everything you might want to know before we hop on a call.

No. Task runners are enabled by default in internal mode, which n8n manages for you. External mode, run from the separate n8nio/runners image, is recommended by n8n for extra security and is required for Python Code nodes.

In n8n 2.0, N8N_BLOCK_ENV_ACCESS_IN_NODE defaults to true. You can set it to false, but n8n's guidance is to use credentials for sensitive data instead of environment variables.

Not as n8n's own database. MySQL and MariaDB are no longer supported storage backends, so migrate to PostgreSQL or SQLite before upgrading. The MySQL node for your business data still works.

On your current version, set N8N_RUNNERS_ENABLED=true to run Code nodes on task runners, and rehearse the full upgrade on a staging copy with a pinned version tag and replayed real inputs.

Keep reading

Let's talk

Ready to build and sell with AI?

Book a free 30 minute strategy call. We'll map the highest ROI AI move for your business, no pitch, just value.