{"record":{"id":"47d9747d89124b68","repo":"n8n-io/n8n","slug":"merge-single-input","errorCode":"MERGE_SINGLE_INPUT","errorMessage":"'${mapKey}' has only ${inputCount} input connection(s). Merge nodes require at least 2 inputs. Wire each upstream branch to a distinct input via `.to(mergeNode.input(0))`, `.to(mergeNode.input(1))`, etc.","messagePattern":"'(.+?)' has only (.+?) input connection\\(s\\)\\. Merge nodes require at least 2 inputs\\. Wire each upstream branch to a distinct input via `\\.to\\(mergeNode\\.input\\(0\\)\\)`, `\\.to\\(mergeNode\\.input\\(1\\)\\)`, etc\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/merge-node-validator.ts","lineNumber":78,"sourceCode":"\t\t\t\t\t// Handle both NodeInstance and InputTarget\n\t\t\t\t\tconst targetNode = isInputTarget(conn.target) ? conn.target.node : conn.target;\n\t\t\t\t\tconst targetNodeName =\n\t\t\t\t\t\ttypeof targetNode === 'object' && 'name' in targetNode ? targetNode.name : undefined;\n\t\t\t\t\tif (targetNode === node || targetNodeName === originalName) {\n\t\t\t\t\t\t// For InputTarget, use the specified index; for regular connections use targetInputIndex; default to 0\n\t\t\t\t\t\tconst targetIndex = isInputTarget(conn.target)\n\t\t\t\t\t\t\t? conn.target.inputIndex\n\t\t\t\t\t\t\t: (conn.targetInputIndex ?? 0);\n\t\t\t\t\t\tconnectedInputIndices.add(targetIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst inputCount = connectedInputIndices.size;\n\t\tif (inputCount < 2) {\n\t\t\tissues.push({\n\t\t\t\tcode: 'MERGE_SINGLE_INPUT',\n\t\t\t\tmessage: `'${mapKey}' has only ${inputCount} input connection(s). Merge nodes require at least 2 inputs. Wire each upstream branch to a distinct input via \\`.to(mergeNode.input(0))\\`, \\`.to(mergeNode.input(1))\\`, etc.`,\n\t\t\t\tseverity: 'warning',\n\t\t\t\tviolationLevel: 'major',\n\t\t\t\tnodeName: mapKey,\n\t\t\t});\n\t\t}\n\n\t\treturn issues;\n\t},\n};\n","sourceCodeStart":60,"sourceCodeEnd":89,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/merge-node-validator.ts#L60-L89","documentation":"Error \"'${mapKey}' has only ${inputCount} input connection(s). Merge nodes require at least 2 inputs. Wire each upstream branch to a distinct input via `.to(mergeNode.input(0))`, `.to(mergeNode.input(1))`, etc.\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/merge-node-validator.ts:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}