{"record":{"id":"6fe0f679b85ccd4c","repo":"n8n-io/n8n","slug":"specific-connection-not-found","errorCode":"SPECIFIC_CONNECTION_NOT_FOUND","errorMessage":"Connection not found: ${sourceNode.name} → ${targetNode.name} (${validatedInput.connectionType}) at output ${validatedInput.sourceOutputIndex} to input ${validatedInput.targetInputIndex}","messagePattern":"Connection not found: (.+?) → (.+?) \\((.+?)\\) at output (.+?) to input (.+?)","errorType":"error_code","errorClass":"ConnectionError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/ai-workflow-builder.ee/src/tools/remove-connection.tool.ts","lineNumber":217,"sourceCode":"\t\t\t\t// Check if the specific connection exists\n\t\t\t\tconst connectionExists = outputConnections.some(\n\t\t\t\t\t(conn) =>\n\t\t\t\t\t\tconn.node === targetNode.name &&\n\t\t\t\t\t\tconn.type === validatedInput.connectionType &&\n\t\t\t\t\t\tconn.index === validatedInput.targetInputIndex,\n\t\t\t\t);\n\n\t\t\t\tif (!connectionExists) {\n\t\t\t\t\tconst connectionError = new ConnectionError(\n\t\t\t\t\t\t`Connection not found: ${sourceNode.name} → ${targetNode.name} (${validatedInput.connectionType}) at output ${validatedInput.sourceOutputIndex} to input ${validatedInput.targetInputIndex}`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfromNodeId: sourceNode.id,\n\t\t\t\t\t\t\ttoNodeId: targetNode.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\tconst error = {\n\t\t\t\t\t\tmessage: connectionError.message,\n\t\t\t\t\t\tcode: 'SPECIFIC_CONNECTION_NOT_FOUND',\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tsourceNode: sourceNode.name,\n\t\t\t\t\t\t\ttargetNode: targetNode.name,\n\t\t\t\t\t\t\tconnectionType: validatedInput.connectionType,\n\t\t\t\t\t\t\tsourceOutputIndex: validatedInput.sourceOutputIndex,\n\t\t\t\t\t\t\ttargetInputIndex: validatedInput.targetInputIndex,\n\t\t\t\t\t\t\texistingConnections: outputConnections.map((conn) => ({\n\t\t\t\t\t\t\t\tnode: conn.node,\n\t\t\t\t\t\t\t\ttype: conn.type,\n\t\t\t\t\t\t\t\tindex: conn.index,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\treporter.error(error);\n\t\t\t\t\treturn createErrorResponse(config, error);\n\t\t\t\t}\n\n\t\t\t\t// Build success message","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/tools/remove-connection.tool.ts#L199-L235","documentation":"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.","triggerScenarios":"Calling remove_connection where the target node, type, or targetInputIndex differs from the actual wiring at the given output branch.","commonSituations":"Target was reconnected to a different input; wrong target node chosen; indices swapped between source output and target input; the connection was already removed.","solutions":["Inspect details.existingConnections for the actual { node, type, index } triples.","Match the target node name and targetInputIndex exactly to one of the listed entries.","Re-issue remove_connection with corrected target or index."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the exact (target, type, targetInputIndex) triple exists before removing.\nconst branch = workflow.connections[sourceNode.name]?.[connectionType]?.[sourceOutputIndex] ?? [];\nconst exists = branch.some((c) => c.node === targetNode.name && c.type === connectionType && c.index === targetInputIndex);\nif (!exists) { /* match against branch entries and correct arguments */ }","typeGuard":null,"tryCatchPattern":"const res = await remove_connection.invoke(input);\nif (isToolError(res) && res.code === 'SPECIFIC_CONNECTION_NOT_FOUND') {\n  const existing = (res.details as any).existingConnections as Array<{ node: string; type: string; index: number }>;\n  // pick the intended entry and re-invoke with its exact coordinates\n}","preventionTips":["Read existingConnections from the response to find the actual wiring before re-trying.","Track connection coordinates (source output + target input) when connecting, to reuse on removal.","Avoid guessing targetInputIndex; look it up from the connections graph."],"tags":["workflow-builder","connections","state","remove"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}