{"record":{"id":"a94134f00fcb6ac2","repo":"n8n-io/n8n","slug":"migration-purgeinvalidworkflowconnections16759405","errorCode":null,"errorMessage":"Migration \"PurgeInvalidWorkflowConnections1675940580449\" is no longer supported. Please upgrade to n8n@1.0.0 first.","messagePattern":"Migration \"PurgeInvalidWorkflowConnections1675940580449\" is no longer supported\\. Please upgrade to n8n@1\\.0\\.0 first\\.","errorType":"exception","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/db/src/migrations/common/1675940580449-PurgeInvalidWorkflowConnections.ts","lineNumber":11,"sourceCode":"import { UserError } from 'n8n-workflow';\n\nimport { WorkflowEntity } from '../../entities';\nimport type { IrreversibleMigration, MigrationContext } from '../migration-types';\n\nexport class PurgeInvalidWorkflowConnections1675940580449 implements IrreversibleMigration {\n\tasync up({ queryRunner }: MigrationContext) {\n\t\tconst workflowCount = await queryRunner.manager.count(WorkflowEntity);\n\n\t\tif (workflowCount > 0) {\n\t\t\tthrow new UserError(\n\t\t\t\t'Migration \"PurgeInvalidWorkflowConnections1675940580449\" is no longer supported. Please upgrade to n8n@1.0.0 first.',\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":17,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/db/src/migrations/common/1675940580449-PurgeInvalidWorkflowConnections.ts#L1-L17","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Boot n8n@1.0.0 against this database first, let the migration complete, then upgrade to your target version.","If the DB is disposable (dev/CI), drop/recreate it and start fresh with the target version.","Restore from a backup taken on a version within the supported upgrade chain, then step through majors in order.","Never manually mark this migration as run on a non-empty DB — the purge logic it gates is the safety property being protected."],"exampleFix":"// before\n# jumping straight from 0.222 to current on a populated DB\nn8n start\n\n// after\n# step through the supported gate first\nn8n@1.0.0 start   # completes migration 1675940580449 against empty/compatible DB\n# then upgrade\nn8n start","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await runMigrations();\n} catch (err) {\n  if (err instanceof UserError && /PurgeInvalidWorkflowConnections.*no longer supported/.test(err.message)) {\n    // instruct: boot n8n@1.0.0 first against this DB, or start fresh\n  } else throw err;\n}","preventionTips":["Always upgrade n8n through the supported version chain — never skip 1.0.0.","For dev/CI, use a disposable DB and let migrations run on an empty schema.","Keep pre-upgrade backups so you can restore and follow the correct sequence."],"tags":["migration","upgrade","version","startup"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}