{"record":{"id":"47789045d4cca9c6","repo":"n8n-io/n8n","slug":"connection-type-inference-error","errorCode":"CONNECTION_TYPE_INFERENCE_ERROR","errorMessage":"${inferResult.error}","messagePattern":"\\$\\{inferResult\\.error\\}","errorType":"error_code","errorClass":"ConnectionError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/src/tools/connect-nodes.tool.ts","lineNumber":150,"sourceCode":"\t\t\t\tlogger?.debug(\n\t\t\t\t\t`Attempting to connect: ${matchedSourceNode.name} -> ${matchedTargetNode.name}`,\n\t\t\t\t);\n\n\t\t\t\tconst inferResult = inferConnectionType(\n\t\t\t\t\tmatchedSourceNode,\n\t\t\t\t\tmatchedTargetNode,\n\t\t\t\t\tsourceNodeType,\n\t\t\t\t\ttargetNodeType,\n\t\t\t\t);\n\n\t\t\t\tif (inferResult.error) {\n\t\t\t\t\tconst connectionError = new ConnectionError(inferResult.error, {\n\t\t\t\t\t\tfromNodeId: matchedSourceNode.id,\n\t\t\t\t\t\ttoNodeId: matchedTargetNode.id,\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: 'CONNECTION_TYPE_INFERENCE_ERROR',\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tsourceNode: matchedSourceNode.name,\n\t\t\t\t\t\t\ttargetNode: matchedTargetNode.name,\n\t\t\t\t\t\t\tpossibleTypes: inferResult.possibleTypes,\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\tif (!inferResult.connectionType) {\n\t\t\t\t\tconst error = {\n\t\t\t\t\t\tmessage: 'Could not infer connection type',\n\t\t\t\t\t\tcode: 'CONNECTION_TYPE_INFERENCE_FAILED',\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tsourceNode: matchedSourceNode.name,\n\t\t\t\t\t\t\ttargetNode: matchedTargetNode.name,\n\t\t\t\t\t\t},","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/tools/connect-nodes.tool.ts#L132-L168","documentation":"inferConnectionType returned an explicit error while trying to derive the connection type between the two matched nodes (e.g. incompatible node types or no shared connection capability). The message is the inference error itself; it is wrapped in a ConnectionError with both node IDs and surfaced to the LLM as a CONNECTION_TYPE_INFERENCE_ERROR tool response.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/connect-nodes.tool.ts:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded inference message — it names the specific incompatibility between source and target","Pick different nodes, or insert an intermediate node that bridges the two types","If node descriptions allow the connection, the version-specific outputs/inputs may mismatch — align node versions","Specify the connection type explicitly if the tool input supports it instead of relying on inference"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}