n8n-io/n8n · error · UserError

Migration "PurgeInvalidWorkflowConnections1675940580449" is

Error message

Migration "PurgeInvalidWorkflowConnections1675940580449" is no longer supported. Please upgrade to n8n@1.0.0 first.

What it means

UserError thrown by migration PurgeInvalidWorkflowConnections1675940580449.up() if any workflows exist in the DB at the time the migration runs. The migration refuses to operate on a non-empty workflow table because the purge logic is unsafe for arbitrary data; the supported path is to upgrade through n8n@1.0.0 first (which runs this migration against an empty or compatible DB).

Source

Thrown at packages/@n8n/db/src/migrations/common/1675940580449-PurgeInvalidWorkflowConnections.ts:11

import { UserError } from 'n8n-workflow';

import { WorkflowEntity } from '../../entities';
import type { IrreversibleMigration, MigrationContext } from '../migration-types';

export class PurgeInvalidWorkflowConnections1675940580449 implements IrreversibleMigration {
	async up({ queryRunner }: MigrationContext) {
		const workflowCount = await queryRunner.manager.count(WorkflowEntity);

		if (workflowCount > 0) {
			throw new UserError(
				'Migration "PurgeInvalidWorkflowConnections1675940580449" is no longer supported. Please upgrade to n8n@1.0.0 first.',
			);
		}
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Boot n8n@1.0.0 against this database first, let the migration complete, then upgrade to your target version.
  2. If the DB is disposable (dev/CI), drop/recreate it and start fresh with the target version.
  3. Restore from a backup taken on a version within the supported upgrade chain, then step through majors in order.
  4. Never manually mark this migration as run on a non-empty DB — the purge logic it gates is the safety property being protected.

Example fix

// before
# jumping straight from 0.222 to current on a populated DB
n8n start

// after
# step through the supported gate first
n8n@1.0.0 start   # completes migration 1675940580449 against empty/compatible DB
# then upgrade
n8n start
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await runMigrations();
} catch (err) {
  if (err instanceof UserError && /PurgeInvalidWorkflowConnections.*no longer supported/.test(err.message)) {
    // instruct: boot n8n@1.0.0 first against this DB, or start fresh
  } else throw err;
}

Prevention

When it happens

Trigger: Starting a recent n8n version against a database that skipped the 1.0.0 upgrade path and already contains workflows. The migration runs on boot, finds workflowCount > 0, and aborts startup.

Common situations: Jumping multiple major versions in one step (e.g. 0.x → 1.x+); restoring a backup from an old version into a new install; a dev DB that was partially migrated then abandoned; CI using a stale DB fixture.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/a94134f00fcb6ac2. Report an issue: GitHub.