n8n-io/n8n · warning · ConnectionError
OUTPUT_INDEX_NOT_FOUND
OUTPUT_INDEX_NOT_FOUND
Error message
Source node "${sourceNode.name}" has no connections at output index ${validatedInput.sourceOutputIndex} What it means
remove_connection drilled into sourceConnections[connectionType] and found that the entry at sourceOutputIndex is missing or not an array. The requested output branch has no connections.
Source
Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/remove-connection.tool.ts:187
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,
},
);
const error = {
message: connectionError.message,
code: 'OUTPUT_INDEX_NOT_FOUND',
details: {
sourceNode: sourceNode.name,
targetNode: targetNode.name,
connectionType: validatedInput.connectionType,
sourceOutputIndex: validatedInput.sourceOutputIndex,
},
};
reporter.error(error);
return createErrorResponse(config, error);
}
// Check if the specific connection exists
const connectionExists = outputConnections.some(
(conn) =>
conn.node === targetNode.name &&
conn.type === validatedInput.connectionType &&
conn.index === validatedInput.targetInputIndex,
);View on GitHub (pinned to 5ac6606e81)
Solutions
- Lower sourceOutputIndex to a populated branch (typically 0).
- Inspect the node's outputs via get_node_details to find which indices have connections.
- Re-issue with the correct index or default (0).
Example fix
// before
remove_connection.invoke({ ..., sourceOutputIndex: 1 });
// after
remove_connection.invoke({ ..., sourceOutputIndex: 0 }); Defensive patterns
Strategy: validation
Validate before calling
// Check the branch at sourceOutputIndex before removing.
const branches = workflow.connections[sourceNode.name]?.[connectionType] ?? [];
if (!Array.isArray(branches[sourceOutputIndex]) || branches[sourceOutputIndex].length === 0) {
// pick a populated index or default to 0
} Try / catch
const res = await remove_connection.invoke(input);
if (isToolError(res) && res.code === 'OUTPUT_INDEX_NOT_FOUND') {
// lower sourceOutputIndex or inspect the node's outputs
} Prevention
- Default sourceOutputIndex to 0 unless the branch is known.
- For IF nodes, remember index 0 = true, 1 = false; only pass 1 if the false branch is wired.
- Inspect node output wiring via get_node_details before disconnecting a specific branch.
When it happens
Trigger: Calling remove_connection with sourceOutputIndex: 1 when only index 0 has connections; off-by-one in index selection.
Common situations: IF node false-branch (index 1) was never wired; Switch node rule index miscounted; the branch was already disconnected.
Related errors
- CONNECTION_NOT_FOUND
- CONNECTION_TYPE_NOT_FOUND
- SPECIFIC_CONNECTION_NOT_FOUND
- INVALID_CONNECTION
- SELF_CONNECTION
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/fcd3c87cc44b6f0e.
Report an issue: GitHub.