n8n-io/n8n · warning · ConnectionError

CONNECTION_TYPE_NOT_FOUND

CONNECTION_TYPE_NOT_FOUND

Error message

Source node "${sourceNode.name}" has no connections of type "${validatedInput.connectionType}"

What it means

remove_connection found the source node's connections object, but it has no entry under the requested connectionType key. details.availableConnectionTypes lists the types that ARE present, so the caller can pick the right one.

Source

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

							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,
						},
					);
					const error = {
						message: connectionError.message,
						code: 'CONNECTION_TYPE_NOT_FOUND',
						details: {
							sourceNode: sourceNode.name,
							targetNode: targetNode.name,
							connectionType: validatedInput.connectionType,
							availableConnectionTypes: Object.keys(sourceConnections),
						},
					};
					reporter.error(error);
					return createErrorResponse(config, error);
				}

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

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Read details.availableConnectionTypes.
  2. Re-issue remove_connection with one of the listed types.
  3. Omit connectionType entirely to use the 'main' default if appropriate.

Example fix

// before
remove_connection.invoke({ sourceNodeId, targetNodeId, connectionType: 'ai_languageModel' });
// after (use an available type from details.availableConnectionTypes)
remove_connection.invoke({ sourceNodeId, targetNodeId, connectionType: 'main' });
Defensive patterns

Strategy: validation

Validate before calling

// List the connection types actually present on the source before removing.
const types = Object.keys(workflow.connections[sourceNode.name] ?? {});
if (!types.includes(requestedType)) { /* pick from types, or default to 'main' */ }

Try / catch

const res = await remove_connection.invoke(input);
if (isToolError(res) && res.code === 'CONNECTION_TYPE_NOT_FOUND') {
  const avail = (res.details as any).availableConnectionTypes as string[];
  // re-invoke with one of `avail`
}

Prevention

When it happens

Trigger: Calling remove_connection with connectionType: 'ai_languageModel' when the source only has 'main' connections, or vice versa.

Common situations: Wrong connection type passed (defaulted to 'main' but the link is an AI sub-node connection); type inferred from the wrong node role; refactor moved a connection to a different type.

Related errors


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