{"record":{"id":"f23552bc8b0087d9","repo":"n8n-io/n8n","slug":"splitinbatches-node-output-connections-are-managed","errorCode":null,"errorMessage":"SplitInBatches node output connections are managed by SplitInBatchesBuilder","messagePattern":"SplitInBatches node output connections are managed by SplitInBatchesBuilder","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/control-flow-builders/split-in-batches.ts","lineNumber":60,"sourceCode":"\n\tupdate(\n\t\tconfig: Partial<NodeConfig>,\n\t): NodeInstance<'n8n-nodes-base.splitInBatches', string, unknown> {\n\t\treturn new SplitInBatchesNodeInstance({\n\t\t\tversion: this.version,\n\t\t\tconfig: {\n\t\t\t\t...this.config,\n\t\t\t\t...config,\n\t\t\t},\n\t\t});\n\t}\n\n\tinput(_index: number): InputTarget {\n\t\tthrow new Error('SplitInBatches node input connections are managed by SplitInBatchesBuilder');\n\t}\n\n\toutput(_index: number): OutputSelector<'n8n-nodes-base.splitInBatches', string, unknown> {\n\t\tthrow new Error('SplitInBatches node output connections are managed by SplitInBatchesBuilder');\n\t}\n\n\tto<T extends NodeInstance<string, string, unknown>>(\n\t\t_target: T | T[] | InputTarget,\n\t\t_outputIndex?: number,\n\t): NodeChain<NodeInstance<'n8n-nodes-base.splitInBatches', string, unknown>, T> {\n\t\tthrow new Error('SplitInBatches node connections are managed by SplitInBatchesBuilder');\n\t}\n\n\tonError<T extends NodeInstance<string, string, unknown>>(_handler: T): this {\n\t\tthrow new Error('SplitInBatches node error handling is managed by SplitInBatchesBuilder');\n\t}\n\n\tgetConnections(): DeclaredConnection[] {\n\t\treturn [];\n\t}\n}\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/control-flow-builders/split-in-batches.ts#L42-L78","documentation":"Thrown by SplitInBatchesNodeInstance.output(). The SplitInBatches node's output ports (each / done) are owned by SplitInBatchesBuilder, which is the only place that can correctly declare which output index a downstream node binds to. Calling .output() on the raw node is blocked for the same ownership reason as .input().","triggerScenarios":"Calling sibNode.output(0) or sibNode.output(1) directly to get an OutputSelector; generic code that fans out via .output(i) for every multi-output node.","commonSituations":"Treating SplitInBatches like a generic multi-output node; constructing a manual connection from a specific SIB output index.","solutions":["Configure output targets through the builder's each/done branches.","Use the fluent builder's .onEachBatch() / .onDone() (fluent variant) to bind output targets.","Do not call .output() on a SplitInBatches node."],"exampleFix":"// before\nsibNode.output(0).to(processNode);\n// after\nsplitInBatches('sib', { each: processNode, done: endNode });","handlingStrategy":"type-guard","validationCode":"function safeOutput(node: NodeInstance, i: number): OutputSelector<any, any, any> {\n  if (node.type === 'n8n-nodes-base.splitInBatches') {\n    throw new Error('Use SplitInBatchesBuilder each/done branches instead of .output()');\n  }\n  return node.output(i);\n}","typeGuard":"function isSplitInBatches(node: NodeInstance): node is NodeInstance<'n8n-nodes-base.splitInBatches', string, unknown> {\n  return node.type === 'n8n-nodes-base.splitInBatches';\n}","tryCatchPattern":null,"preventionTips":["Never call .output() on a SplitInBatches node; configure each/done branches via the builder.","Filter SplitInBatches nodes out of generic fan-out loops.","Use the builder's getConnection() / getAllNodes() to inspect declared edges."],"tags":["runtime","builder","split-in-batches","connections"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}