Updating n8n without surprises

n8n ships fixes almost every day and security advisories several times a month. Self-hosted n8n does not update itself. This page covers how to keep watch, when to update straight away, and a script that backs up, upgrades and checks that everything runs afterwards.

Last checked:

Step by stepKeeping watch without reading GitHub every day
  1. Releases
  2. Changes that need action
  3. Security

How often does something new come out?

More often than most people expect. On 20 November 2026 n8n released a new stable fix and a fix for an older 1.x line on the same day, with two pre-releases of the next version also out. So far in 2026 n8n has published 228 security advisories on GitHub: 19 critical, 99 high, 108 medium and 2 low. Since late August alone there have been 36 high and 45 medium.

One example: advisory GHSA-9p7v-45m2-wxgj of 28 October 2026 is rated high. The deprecated code nodes (Function, Function Item and LangChain Code) could run code in n8n’s main process, outside the task runner’s isolation. The fix shipped in 2.42.6, 2.43.3 and 3.0.1. Until you have upgraded, you can block those nodes with NODES_EXCLUDE.

n8n uses semantic versioning: a new first number can require action from you, a new middle number adds features, and the last number is fixes. Day to day it is the last two that keep you busy.

Keeping watch without reading GitHub every day

  1. Releases: subscribe to GitHub’s releases feed for n8n-io/n8n in an RSS reader or in a Teams or Slack channel.
  2. Changes that need action: n8n’s release notes are also available as an RSS feed. Read the notes for every version between the one you run and the one you are moving to.
  3. Security: run the script below once a day. It fetches n8n’s public advisories and lists the high and critical ones since a given date, with the versions that fix them.
#!/usr/bin/env bash
# check-advisories.sh – high and critical n8n advisories since a date
# Usage: ./check-advisories.sh 2026-11-01   (needs curl and jq)
set -euo pipefail
SINCE="${1:-$(date -d '-7 days' +%F)}"
curl -fsS -H "Accept: application/vnd.github+json" \
  "https://api.github.com/repos/n8n-io/n8n/security-advisories?per_page=100&sort=published&direction=desc" |
jq -r --arg since "$SINCE" '
  .[]
  | select(.published_at >= $since)
  | select(.severity == "critical" or .severity == "high")
  | [.published_at[:10], .severity, .ghsa_id,
     ([.vulnerabilities[].patched_versions] | join(" / ")), .summary]
  | @tsv'

GitHub’s API needs no login for public advisories, but without one there is a cap on calls per hour. Once a day is far below it. Have the output sent to you whenever it has lines. Empty output means no new high or critical advisories.

We run a routine of our own that checks our n8n instances every hour, backs up every workflow daily and keeps the backups for 30 days. It is one of the 39 automated maintenance routines that look after our operations.

Pinned version or always the latest?

Three ways to manage the n8n version

ApproachHowUpsideRisk
Follow the latestImage tag latest or stable, updated on every restartFixes arrive quicklyA restart can give you a version nobody has tested
Pinned version, deliberate updatesFixed version number in .env, update monthly and at once on a high/critical advisoryYou know what runs, and you test firstSomeone actually has to do it
Stay on a major lineStay on an older line and take only its fixesFewer feature changesFixes may not come, and the later jump gets big
Our own assessment. n8n recommends updating at least once a month and pinning a specific image tag instead of latest (docs.n8n.io, checked 20.11.2026).

We know both extremes from our own operations. One of our instances follows the newest release, the other is pinned by a deliberate decision because it runs flows that must not change. For a business we recommend the middle option. n8n itself says that frequent updates keep each jump small and less risky, and that you should pin a specific image tag rather than latest.

Vendors move under you too. When OpenAI retired older models on 27 October 2026, we had to move 56 workflows on both instances to new models, and two weeks later 111 nodes ran on the new model. That was not an n8n update, but it takes the same discipline: test before you trust it.

Test on staging before production

A staging instance does not have to be big. A small extra server or a container with a copy of last night’s backup is enough:

  1. Restore last night’s database dump and the .n8n folder with the encryption key on staging. Without the key, credentials can’t be read.
  2. Switch off outgoing steps or point them at test recipients, so staging never writes to customers.
  3. Update staging to the new version and run your regression test: the 5–10 most important flows, started through test webhooks.
  4. Compare the result, not the status. In a salon reminder workflow, 12 of 207 text messages were never sent while every run showed success. A regression test therefore has to check what the response contains.

We run a set of regression tests after every n8n update ourselves. We use the same principle elsewhere: our own product bkg.dk takes a database dump before every deploy and has a one-command rollback script. Its latest release on 2 November 2026 went out with 2,782 passing tests. And when we moved our own CRM up a full major version, the data moved 1:1 and 57 of 57 tests passed before the old version was removed.

The update script

The script fits the setup on our self-hosted n8n with Docker page: a pinned version in .env, PostgreSQL, a task runner in its own container and Caddy in front. It exports workflows and credentials, takes a full database dump, records the latest database migration, switches the version for both n8n and the task runner, and waits until n8n reports ready.

#!/usr/bin/env bash
# /opt/n8n/update.sh <new-version>   e.g.: ./update.sh 2.48.7
set -euo pipefail
NEW="${1:?Give the new version, e.g. 2.48.7}"
cd /opt/n8n
set -a; . ./.env; set +a
OLD="$N8N_VERSION"
stamp="$(date +%F-%H%M)-before-$NEW"
mkdir -p "backups/$stamp" && chown -R 1000:1000 backups

# 1) backup before the update: workflows, credentials (encrypted) and the whole database
docker compose exec -T n8n n8n export:workflow --backup --output="/backups/$stamp/workflows/"
docker compose exec -T n8n n8n export:credentials --backup --output="/backups/$stamp/credentials/"
docker compose exec -T postgres pg_dump -U "$POSTGRES_USER" -Fc "$POSTGRES_DB" > "backups/$stamp/n8n.dump"
test -s "backups/$stamp/n8n.dump" || { echo "Empty dump – stopping"; exit 1; }

# 2) record the latest migration so you know where to go back to
docker compose exec -T postgres psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Atc \
  "SELECT name FROM migrations ORDER BY id DESC LIMIT 1;" > "backups/$stamp/last-migration.txt"

# 3) the same pinned version for n8n and the task runner – never latest
sed -i "s/^N8N_VERSION=.*/N8N_VERSION=$NEW/" .env
docker compose pull n8n n8n-runner
docker compose up -d n8n n8n-runner

# 4) health check: database connected and migrated (up to 5 minutes)
for i in $(seq 1 30); do
  if curl -fsS "https://$N8N_DOMAIN/healthz/readiness" >/dev/null; then
    echo "OK: n8n $NEW is ready (was: $OLD). Now run the regression test."
    exit 0
  fi
  sleep 10
done
echo "ERROR: n8n $NEW did not become ready. Roll back to $OLD – see below." >&2
docker compose logs n8n --since 10m | tail -50
exit 1

/healthz returns 200 as soon as n8n is reachable but says nothing about the database. /healthz/readiness only returns 200 once the database is connected and migrated, which is why the script waits for it.

Rolling back: an old image tag does not roll database migrations back. Stop n8n and the task runner, restore the dump from the before-<version> folder, put the old version back in .env, and start again. n8n also has n8n db:revert, which removes one migration per run, but it can exit with status 0 without having done anything. Read the output, or use the dump.

Keep the backup somewhere other than the server too. Our own rule is that every backup goes to an external storage service and that dumps stay on the server for two days at most. We learned that a control panel may keep a local copy only when the upload fails – so a failed upload means no off-site backup at all.

When it is urgent

If a critical or high advisory hits your version and the nodes you use, skip the monthly rhythm: run the script on staging that day and do production afterwards. If you can’t update straight away, use the temporary workaround the advisory describes, for example NODES_EXCLUDE. General security settings – reverse proxy, HMAC on webhooks and tokens out of URLs – are on n8n security.

On n8n Cloud you control updates from the Cloud console and n8n runs the server. It is one of the few strong arguments for Cloud if nobody on your side has time for the routine.

Sources

Last reviewed: 2026-12-03

Questions about updating n8n

How often should we update n8n?

At least once a month, as n8n itself recommends, and the same day a high or critical advisory hits your version. Small, frequent jumps are safer than one big one.

Can we skip several versions at once?

Yes, but read the release notes for every version in between and test on staging first. The bigger the jump, the more database migrations run in one go.

What do we do if the update fails?

Stop n8n, restore the database dump from before the update, put the old version back in .env, and start again. An old image tag on its own does not roll the database back.

Does the task runner need updating separately?

Yes, but always to the same version as n8n. The script switches both at once because they share the version number in .env.

Fixed price, no commitment

Get a fixed price for your n8n task

Tell us briefly what you use today and what you want to achieve. A person answers by e-mail with a proposal and a fixed price before any work starts.

  • A fixed price before we start
  • An answer by e-mail, no calls
  • Your details are used only to answer you

Fields marked with * are required.

What is it about?