n8n-io/n8n · warning · ConnectionError

SPECIFIC_CONNECTION_NOT_FOUND

SPECIFIC_CONNECTION_NOT_FOUND

Error message

Connection not found: ${sourceNode.name} → ${targetNode.name} (${validatedInput.connectionType}) at output ${validatedInput.sourceOutputIndex} to input ${validatedInput.targetInputIndex}

What it means

remove_connection found the source/output/type branch, but no connection in that branch matches the (targetNode.name, connectionType, targetInputIndex) tuple. details.existingConnections lists what is actually wired at that branch so the caller can correct the arguments.

Source

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

				// Check if the specific connection exists
				const connectionExists = outputConnections.some(
					(conn) =>
						conn.node === targetNode.name &&
						conn.type === validatedInput.connectionType &&
						conn.index === validatedInput.targetInputIndex,
				);

				if (!connectionExists) {
					const connectionError = new ConnectionError(
						`Connection not found: ${sourceNode.name} → ${targetNode.name} (${validatedInput.connectionType}) at output ${validatedInput.sourceOutputIndex} to input ${validatedInput.targetInputIndex}`,
						{
							fromNodeId: sourceNode.id,
							toNodeId: targetNode.id,
						},
					);
					const error = {
						message: connectionError.message,
						code: 'SPECIFIC_CONNECTION_NOT_FOUND',
						details: {
							sourceNode: sourceNode.name,
							targetNode: targetNode.name,
							connectionType: validatedInput.connectionType,
							sourceOutputIndex: validatedInput.sourceOutputIndex,
							targetInputIndex: validatedInput.targetInputIndex,
							existingConnections: outputConnections.map((conn) => ({
								node: conn.node,
								type: conn.type,
								index: conn.index,
							})),
						},
					};
					reporter.error(error);
					return createErrorResponse(config, error);
				}

				// Build success message

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Inspect details.existingConnections for the actual { node, type, index } triples.
  2. Match the target node name and targetInputIndex exactly to one of the listed entries.
  3. Re-issue remove_connection with corrected target or index.
Defensive patterns

Strategy: validation

Validate before calling

// Verify the exact (target, type, targetInputIndex) triple exists before removing.
const branch = workflow.connections[sourceNode.name]?.[connectionType]?.[sourceOutputIndex] ?? [];
const exists = branch.some((c) => c.node === targetNode.name && c.type === connectionType && c.index === targetInputIndex);
if (!exists) { /* match against branch entries and correct arguments */ }

Try / catch

const res = await remove_connection.invoke(input);
if (isToolError(res) && res.code === 'SPECIFIC_CONNECTION_NOT_FOUND') {
  const existing = (res.details as any).existingConnections as Array<{ node: string; type: string; index: number }>;
  // pick the intended entry and re-invoke with its exact coordinates
}

Prevention

When it happens

Trigger: Calling remove_connection where the target node, type, or targetInputIndex differs from the actual wiring at the given output branch.

Common situations: Target was reconnected to a different input; wrong target node chosen; indices swapped between source output and target input; the connection was already removed.

Related errors


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