n8n, a tool we use almost every day here at NetBird, just had a major release. v2.0 beta is now ready to test out in their next release branch. While version 1.0 was about stability and reaching "maturity," Version 2.0 is an architectural shift designed to make n8n enterprise-ready and developer-friendly. The shift is comparable to moving from "writing scripts directly on a server" to "using a proper CI/CD pipeline."
Here is the breakdown of some of the major changes.
1. The End of "Hot Edits" (Draft vs. Publish)
The single biggest workflow change in v2 is the separation of development and production.
- In v1: There was only one button: Save. If you saved a workflow, you effectively deployed it. Debugging a live production workflow was risky; if you hit save on a broken node, you broke production immediately.
- In v2: You now have Draft and Published states. You can edit, debug, and break your "Draft" version as much as you want without affecting the live version running in the background. You must explicitly click Publish to push your changes to production.
2. True Human-in-the-Loop
If you build AI agents or approval flows, v2 fixes a major architectural limitation regarding long-running tasks.
- The Fix: In v1, if a parent workflow called a sub-workflow that needed to wait for a human approval (e.g., via Slack), the connection would often time out or return incorrect results. In v2, this is native. The Parent Workflow effectively "pauses" and waits for the Sub-workflow to complete—even if it takes days for a human to click "Approve." Once approved, the data flows back to the Parent seamlessly.
The Architecture of Stability
This is arguably the most critical "under the hood" change in v2, specifically regarding stability and security.
In v1, running custom code (JavaScript/Python) was like letting a stranger drive your car while you were sitting in the passenger seat. If they crashed, you both crashed. In v2, with Task Runners, it's like controlling a remote-controlled car. If the RC car crashes, you are safe standing on the sidewalk.
v1: In-Process Execution (The Risk)
Previously, custom code ran inside the same operating system process as the main n8n server.
- The Crash Risk: If your JavaScript had a memory leak or an infinite loop, it consumed the host server's resources. This would cause the entire n8n instance to crash, killing all other active workflows and webhooks.
- The Security Risk: Because code ran in the main process, a clever user could theoretically access internal server environment variables.
v2: Task Runners (The Solution)
Version 2 introduces Task Runners—separate processes dedicated entirely to executing custom code.
- Isolation: When a workflow hits a Code Node, n8n sends the data to the Task Runner. If your Python script crashes, only the Task Runner fails. The main n8n server stays alive, simply marking that specific execution as an "Error."
- Performance: Heavy data transformation tasks (like processing large JSON files) no longer block the main event loop. Your webhook listeners remain responsive even while heavy computation happens in the background.
Python as a First-Class Citizen
This architecture moves Python from "experimental" to stable. The old Pyodide-based Python node has been removed and replaced with a native Python implementation running on Task Runners. Because the Task Runner is a native Python environment, it supports installs and provides a reliable playground for data scientists who prefer Python over JS.
Summary Checklist for Upgrading
If you are moving to v2, be aware of these requirements:
- Database: MySQL and MariaDB are no longer supported. You must use PostgreSQL or SQLite. If you're currently on MySQL/MariaDB, migrate your data before upgrading.
- Docker: You will likely need to adjust your container setup to include the new "Task Runner" sidecar containers if you want code isolation in external mode.
- Variables: Code nodes can no longer access by default; you must explicitly allowlist the variables you want to expose.
This is just an overview of the changes; please check out their official docs, website, and blog post on this update!
Installing n8n with NPM
This quick guide walks through setting up n8n as a persistent background service using PM2.
Prerequisites
Install Node.js, npm, and nvm. Visit the official download page for an updated command and different platforms.
Step 1: Install or Update n8n
Install n8n globally via npm:
Install n8n globally via npm with their next channel for v2:
To update an existing installation to the latest version:
Verify the installation:
Step 2: Install PM2
PM2 is a production-ready process manager for Node.js applications. Running n8n directly in a terminal means it stops when you close the session. PM2 solves this by:
- Keeping n8n running in the background
- Automatically restarting it if it crashes
- Starting n8n on system boot
- Managing environment variables cleanly
- Providing monitoring and log management
Install PM2 globally:
Step 3: Create the PM2 Configuration File
Create a configuration file in your home directory. This file tells PM2 how to run n8n and what environment variables to use.
Add the following content:
Save and exit (Ctrl+X, then Y, then Enter).
Environment Variables Explained
| Variable | Purpose |
|---|---|
| Set to to remove the [DEV] tag in the browser and enable production optimizations | |
| The IP address n8n listens on. Use to accept connections from any interface, or a specific IP to restrict access | |
| The port n8n runs on (default: 5678) | |
| The public URL for webhooks. Required for triggers and external integrations to reach your instance |
Step 4: Start n8n with PM2
Launch n8n using the configuration file:
Step 5: Enable Startup on Boot
Generate the startup script and save the current process list:
This outputs a command you need to run with sudo—copy and execute it. Then save the process list:
Now n8n will automatically start when your system boots.
PM2 Command Reference
Basic Process Management
| Command | Description |
|---|---|
| Start n8n using the config file | |
| Stop the n8n process | |
| Restart n8n | |
| Remove n8n from PM2's process list |
Monitoring and Logs
| Command | Description |
|---|---|
| Show all managed processes and their status | |
| Real-time monitoring dashboard (CPU, memory, logs) | |
| View n8n logs (Ctrl+C to exit) | |
| View last 100 lines of logs |
Configuration Changes
When you modify , apply the changes with:
Alternatively, for environment variable updates only:
Useful Diagnostics
| Command | Description |
|---|---|
| Detailed information about the n8n process | |
| Show environment variables for process ID 0 |
Where is My Data Stored?
Your n8n data (workflows, credentials, settings) is stored separately from PM2 in:
Deleting and recreating the PM2 process does not affect your workflows or credentials.
Using n8n with NetBird
Check out our initial n8n video for a real use-case example using NetBird peers and resources with your workflows.
