n8n-io/n8n · info · ValidationError

SAME_NAME

SAME_NAME

Error message

Node "${oldName}" already has this name

What it means

rename_node detected that newName equals the node's current name (oldName === newName). The tool refuses the no-op rather than performing a redundant write, returning code SAME_NAME with both currentName and newName in details.

Source

Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/rename-node.tool.ts:72

				const node = validateNodeExists(validatedInput.nodeId, workflow.nodes);

				if (!node) {
					const error = createNodeNotFoundError(validatedInput.nodeId);
					reporter.error(error);
					return createErrorResponse(config, error);
				}

				const oldName = node.name;
				const newName = validatedInput.newName;

				if (oldName === newName) {
					const validationError = new ValidationError(`Node "${oldName}" already has this name`, {
						field: 'newName',
						value: newName,
					});
					const error = {
						message: validationError.message,
						code: 'SAME_NAME',
						details: {
							nodeId: validatedInput.nodeId,
							currentName: oldName,
							newName,
						},
					};
					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',

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Pick a genuinely different newName.
  2. If the goal was only to ensure the node has that name, treat the response as success.
  3. Call list_nodes to confirm current names before renaming.
Defensive patterns

Strategy: validation

Validate before calling

// Compare against the node's current name before invoking rename_node.
const node = workflow.nodes.find((n) => n.id === input.nodeId);
if (node && node.name === input.newName) { /* no-op: nothing to rename */ }

Try / catch

const res = await rename_node.invoke(input);
if (isToolError(res) && res.code === 'SAME_NAME') {
  // desired state already holds; proceed without error
}

Prevention

When it happens

Trigger: rename_node invoked with newName identical to node.name.

Common situations: The LLM hallucinates the existing name as the 'new' name; an idempotent retry after a partial success; a client retry loop.

Related errors


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