n8n-io/n8n · warning · ConnectionError

CONNECTION_NOT_FOUND

CONNECTION_NOT_FOUND

Error message

Source node "${sourceNode.name}" has no outgoing connections

What it means

remove_connection found that workflow.connections has no key for sourceNode.name at all, meaning the source node has zero outgoing connections of any type. The tool refuses to proceed because there is nothing to remove.

Source

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

				// Report progress
				reportProgress(
					reporter,
					`Removing connection from ${sourceNode.name} to ${targetNode.name}...`,
				);

				// Check if the connection exists
				const sourceConnections = workflow.connections[sourceNode.name];
				if (!sourceConnections) {
					const connectionError = new ConnectionError(
						`Source node "${sourceNode.name}" has no outgoing connections`,
						{
							fromNodeId: sourceNode.id,
							toNodeId: targetNode.id,
						},
					);
					const error = {
						message: connectionError.message,
						code: 'CONNECTION_NOT_FOUND',
						details: {
							sourceNode: sourceNode.name,
							targetNode: targetNode.name,
							connectionType: validatedInput.connectionType,
						},
					};
					reporter.error(error);
					return createErrorResponse(config, error);
				}

				const connectionTypeOutputs = sourceConnections[validatedInput.connectionType];
				if (!connectionTypeOutputs || !Array.isArray(connectionTypeOutputs)) {
					const connectionError = new ConnectionError(
						`Source node "${sourceNode.name}" has no connections of type "${validatedInput.connectionType}"`,
						{
							fromNodeId: sourceNode.id,
							toNodeId: targetNode.id,
						},

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Verify the source actually has outgoing connections via get_node_details or get_workflow.
  2. Use the correct source node (the upstream producer).
  3. Treat as already-disconnected (idempotent success) if the goal was simply to ensure no connection exists.
Defensive patterns

Strategy: validation

Validate before calling

// Inspect workflow.connections before calling remove_connection.
function hasOutgoing(workflow: SimpleWorkflow, sourceName: string): boolean {
  return Object.prototype.hasOwnProperty.call(workflow.connections, sourceName);
}

if (!hasOutgoing(workflow, sourceNode.name)) { /* nothing to remove; treat as success */ }

Try / catch

const res = await remove_connection.invoke(input);
if (isToolError(res) && res.code === 'CONNECTION_NOT_FOUND') {
  // idempotent: the source has no outgoing connections, so the desired state holds.
}

Prevention

When it happens

Trigger: Calling remove_connection on a source node that was never connected, or whose connections object was never initialized.

Common situations: Trigger/terminal node with no downstream; connection was already removed in a prior call; freshly added node not yet wired.

Related errors


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