{"record":{"id":"2600f1fd81354aec","repo":"n8n-io/n8n","slug":"409","errorCode":"409","errorMessage":"Cannot ${action} workflow - you have this workflow open in another tab","messagePattern":"Cannot (.+?) workflow - you have this workflow open in another tab","errorType":"http","errorClass":"ConflictError","httpStatus":409,"severity":"warning","filePath":"packages/cli/src/collaboration/collaboration.service.ts","lineNumber":397,"sourceCode":"\t\taction: string,\n\t): Promise<void> {\n\t\tif (!clientId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lock = await this.state.getWriteLock(workflowId);\n\n\t\tif (!lock) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lock.clientId === clientId) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lock.userId === userId) {\n\t\t\t// Same user, different tab\n\t\t\tthrow new ConflictError(\n\t\t\t\t`Cannot ${action} workflow - you have this workflow open in another tab`,\n\t\t\t);\n\t\t} else {\n\t\t\t// Different user\n\t\t\tthrow new LockedError(`Cannot ${action} workflow - another user currently has write access`);\n\t\t}\n\t}\n}\n","sourceCodeStart":379,"sourceCodeEnd":406,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/collaboration/collaboration.service.ts#L379-L406","documentation":"validateWriteLock throws ConflictError (409) when the write lock is held by the same userId but a different clientId — i.e. the same user has the workflow open in another browser tab and the action would conflict with that tab.","triggerScenarios":"Request supplies userId+clientId, getWriteLock returns a lock with same lock.userId but different lock.clientId; the action parameter is interpolated into the message (e.g. 'save', 'activate').","commonSituations":"User has n8n open in two tabs and edits/saves in one while the other holds the lock; stale tab after a refresh; multiple windows of the same browser session.","solutions":["Close the other editor tab(s) for that workflow and retry.","Refresh the conflicting tab so it re-acquires/releases the lock correctly.","Avoid editing the same workflow in multiple tabs simultaneously."],"exampleFix":"n/a","handlingStrategy":"try-catch","validationCode":"n/a (lock holder state is server-side and changes asynchronously)","typeGuard":"function isConflictError(error: unknown): boolean {\n  return error instanceof Error && /open in another tab/.test(error.message);\n}","tryCatchPattern":"try {\n  await collaborationService.validateWriteLock(userId, clientId, workflowId, action);\n} catch (e) {\n  if (isConflictError(e)) { /* 409: tell user to close the other tab */ }\n  else throw e;\n}","preventionTips":["Avoid opening the same workflow in multiple tabs.","Refresh stale tabs to reconcile clientId/lock state.","On 409, prompt the user to take over rather than retry blindly."],"tags":["collaboration","locking","conflict","http-409"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}