n8n-io/n8n · error

EXECUTION_ERROR

EXECUTION_ERROR

Error message

Unknown error occurred

What it means

A non-Error, non-ZodError value was thrown inside remove_connection. The catch block emits 'Unknown error occurred' with code EXECUTION_ERROR because the thrown value has no .message. This signals a defect or unexpected rejection shape rather than a user-input problem.

Source

Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/remove-connection.tool.ts:283

				return createSuccessResponse(config, message, stateUpdates);
			} catch (error) {
				// Handle validation or unexpected errors
				let toolError;

				if (error instanceof z.ZodError) {
					const validationError = new ValidationError('Invalid connection removal parameters', {
						field: error.errors[0]?.path.join('.'),
						value: error.errors[0]?.message,
					});
					toolError = {
						message: validationError.message,
						code: 'VALIDATION_ERROR',
						details: error.errors,
					};
				} else {
					toolError = {
						message: error instanceof Error ? error.message : 'Unknown error occurred',
						code: 'EXECUTION_ERROR',
					};
				}

				reporter.error(toolError);
				return createErrorResponse(config, toolError);
			}
		},
		{
			name: REMOVE_CONNECTION_TOOL.toolName,
			description: `Remove a specific connection between two nodes in the workflow. This allows you to disconnect nodes without deleting them.

USAGE:
Use this tool when you need to break an existing connection while keeping both nodes in the workflow.

PARAMETERS:
- sourceNodeId: The UUID of the node that is the source of the connection (where the data comes from)
- targetNodeId: The UUID of the node that receives the connection (where the data goes to)
- connectionType: The type of connection to remove (default: "main")

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Inspect server logs around the tool invocation for the raw thrown value.
  2. Reproduce with the same workflow JSON and connection coordinates.
  3. Report as a bug with the workflow JSON, node names, and connection coordinates.
Defensive patterns

Strategy: try-catch

Type guard

function isToolError(v: unknown): v is { message: string; code: string; details?: unknown } {
  return typeof v === 'object' && v !== null && 'code' in v && 'message' in v;
}

Try / catch

const res = await remove_connection.invoke(input);
if (isToolError(res) && res.code === 'EXECUTION_ERROR' && res.message === 'Unknown error occurred') {
  // defect path: log workflow JSON + connection coordinates, do not blindly retry
}

Prevention

When it happens

Trigger: A helper throws a non-Error value; a promise rejects with a string/null; an internal invariant throws a literal.

Common situations: Bug in removeConnectionFromWorkflow state helper; race on workflow state access; unhandled edge case in connection array manipulation.

Related errors


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