n8n-io/n8n · error · ValidationError
NAME_CONFLICT
NAME_CONFLICT
Error message
A node with the name "${newName}" already exists What it means
rename_node found another node in workflow.nodes whose name equals newName and whose id differs from the target. n8n requires node names to be unique (they key the connections object), so the rename is refused with code NAME_CONFLICT and the conflicting node's ID in details.
Source
Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/rename-node.tool.ts:96
};
reporter.error(error);
return createErrorResponse(config, error);
}
const existingNode = workflow.nodes.find(
(n) => n.name === newName && n.id !== validatedInput.nodeId,
);
if (existingNode) {
const validationError = new ValidationError(
`A node with the name "${newName}" already exists`,
{
field: 'newName',
value: newName,
},
);
const error = {
message: validationError.message,
code: 'NAME_CONFLICT',
details: {
nodeId: validatedInput.nodeId,
newName,
conflictingNodeId: existingNode.id,
},
};
reporter.error(error);
return createErrorResponse(config, error);
}
logger?.debug('\n=== Rename Node Tool ===');
logger?.debug(`Renaming node: "${oldName}" -> "${newName}"`);
reportProgress(reporter, `Renaming "${oldName}" to "${newName}"...`);
const message = buildResponseMessage(oldName, newName);
logger?.debug('Node will be renamed');View on GitHub (pinned to 5ac6606e81)
Solutions
- Choose a unique newName not present in workflow.nodes.
- Rename the conflicting node first (or delete it) to free the name.
- Append a suffix or counter to disambiguate (e.g. 'Process Data (2)').
Defensive patterns
Strategy: validation
Validate before calling
// Check name uniqueness before invoking rename_node.
const taken = workflow.nodes.some((n) => n.name === newName && n.id !== nodeId);
if (taken) { /* pick a distinct name or rename the conflicting node first */ } Try / catch
const res = await rename_node.invoke(input);
if (isToolError(res) && res.code === 'NAME_CONFLICT') {
const conflictId = (res.details as any).conflictingNodeId;
// rename or delete the conflicting node first, then retry
} Prevention
- Always check name uniqueness against workflow.nodes before renaming.
- Maintain a set of in-use names in agent state.
- Disambiguate with suffixes (e.g. ' (2)') when collisions are likely.
When it happens
Trigger: rename_node with a newName that matches a different node's name.
Common situations: Trying to rename to an in-use name; duplicate name after cloning; renaming to a name freed by a not-yet-applied deletion.
Related errors
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/14053a23669323c8.
Report an issue: GitHub.