{"record":{"id":"2274a008ae3b32b1","repo":"n8n-io/n8n","slug":"splitinbatches-node-error-handling-is-managed-by-s","errorCode":null,"errorMessage":"SplitInBatches node error handling is managed by SplitInBatchesBuilder","messagePattern":"SplitInBatches node error handling is 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":71,"sourceCode":"\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\n/**\n * A batch of nodes - either a single node or an array of nodes for fan-out\n */\nexport type NodeBatch =\n\t| NodeInstance<string, string, unknown>\n\t| Array<NodeInstance<string, string, unknown>>;\n\n/**\n * Target for a branch in named object syntax.\n * Can be:\n * - null: no connection for this branch","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/control-flow-builders/split-in-batches.ts#L53-L89","documentation":"Thrown by SplitInBatchesNodeInstance.onError(). Error routing for SplitInBatches must be configured through the builder, not the generic per-node onError hook, because the loop semantics interact with error handling. The node-level onError is therefore blocked.","triggerScenarios":"Calling sibNode.onError(errorHandler) to attach an error route directly; generic error-wiring code that calls onError on every node.","commonSituations":"Attaching an error handler uniformly across all nodes in a list; assuming onError works the same on loop nodes.","solutions":["Configure error handling through the SplitInBatches builder API.","Attach onError to the surrounding non-loop nodes instead.","Filter SplitInBatches nodes out before applying a uniform onError pass."],"exampleFix":"// before\nsibNode.onError(errorHandler);\n// after\n// wire error handling on the nodes inside the each/done branches,\n// or via the builder's dedicated error configuration","handlingStrategy":"type-guard","validationCode":"function safeOnError(node: NodeInstance, handler: NodeInstance): void {\n  if (node.type === 'n8n-nodes-base.splitInBatches') {\n    throw new Error('Configure SIB error handling via the builder');\n  }\n  node.onError(handler);\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":["Attach onError to surrounding non-loop nodes rather than the SplitInBatches node.","Filter SplitInBatches nodes out before a uniform onError pass.","Use the builder's error configuration for loop error handling."],"tags":["runtime","builder","split-in-batches","error-handling"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}