n8n-io/n8n · warning · LockedError
423
423
Error message
Cannot modify workflow while it is being edited by a user in the editor.
What it means
CollaborationService.ensureWorkflowEditable throws LockedError (423) when any user currently holds the write lock for the workflow. Used to block mutations (save, activate, delete) while someone is editing in the UI.
Source
Thrown at packages/cli/src/collaboration/collaboration.service.ts:364
*/
async getWriteLock(
userId: User['id'],
workflowId: Workflow['id'],
): Promise<{ clientId: string; userId: string } | null> {
if (!(await this.accessService.hasReadAccess(userId, workflowId))) {
return null;
}
return await this.state.getWriteLock(workflowId);
}
/**
* Throws if any user currently holds the write lock for the given workflow.
*/
async ensureWorkflowEditable(workflowId: Workflow['id']): Promise<void> {
const lock = await this.state.getWriteLock(workflowId);
if (lock) {
throw new LockedError(
'Cannot modify workflow while it is being edited by a user in the editor.',
);
}
}
/**
* Validates that if a write lock exists for a workflow, the requesting client holds it.
* Throws ConflictError (409) if same user but different tab holds the lock.
* Throws LockedError (423) if different user holds the lock.
*/
async validateWriteLock(
userId: User['id'],
clientId: string | undefined,
workflowId: Workflow['id'],
action: string,
): Promise<void> {
if (!clientId) {
return;View on GitHub (pinned to 5ac6606e81)
Solutions
- Have the locking user close the editor tab to release the lock, then retry.
- Wait for the lock TTL to expire if the holder is idle.
- Use the collaboration 'take over' flow if available, or coordinate edit windows.
Example fix
n/a
Defensive patterns
Strategy: try-catch
Validate before calling
// Before mutating, check editability
const lock = await collaborationService.state.getWriteLock(workflowId);
if (lock) { /* someone holds it: surface 423 to caller */ } Type guard
function isLockedError(error: unknown): boolean {
return error instanceof Error && /Cannot modify workflow/.test(error.message);
} Try / catch
try {
await collaborationService.ensureWorkflowEditable(workflowId);
} catch (e) {
if (isLockedError(e)) { /* return 423, ask user to retry later */ }
else throw e;
} Prevention
- Close editor tabs to release locks before automating workflow changes.
- Use dedicated service accounts for CI to avoid colliding with users.
- Honor lock TTLs and retry with backoff on 423.
When it happens
Trigger: A mutating API call hits ensureWorkflowEditable and state.getWriteLock(workflowId) returns a non-null lock — another user (or the same user in another tab) has the editor open in write mode.
Common situations: Two users editing the same workflow; a user closed the tab without releasing the lock (lock TTL still active); automation/CI trying to save a workflow a user has open.
Related errors
- 409
- Workflow "${workflowId}" not found.
- Cannot publish archived Workflow
- Version "${versionIdToPublish}" not found for workflow "${wo
- Workflow ${workflowId} not found in sqlite db
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/6eb796e2d9305359.
Report an issue: GitHub.