{"record":{"id":"3e6f760477b018f5","repo":"n8n-io/n8n","slug":"edge-edge-from-edge-to-has-slot-index-in","errorCode":null,"errorMessage":"Edge ${edge.from} → ${edge.to} has slot index ${index}; slot indices above ${MAX_SLOT_INDEX} are not supported yet","messagePattern":"Edge (.+?) → (.+?) has slot index (.+?); slot indices above (.+?) are not supported yet","errorType":"exception","errorClass":"GraphValidationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/engine/src/graph/validate-executable-graph.ts","lineNumber":47,"sourceCode":"\t}\n\n\t// TODO(CAT-2875): loop iteration needs re-runnable steps; until that lands,\n\t// graphs with back-edges are rejected outright rather than deadlocking.\n\tif (graph.edges.some((edge) => edge.isBackEdge)) {\n\t\tthrow new UnimplementedError('Graphs with back-edges (loops) are not supported yet');\n\t}\n\n\t// Slot indices are structural, so they're enforced here rather than left to\n\t// the transport boundary. TODO(CAT-3042): enforce an upper bound too.\n\tfor (const edge of graph.edges) {\n\t\tfor (const index of [edge.outputIndex, edge.inputIndex]) {\n\t\t\tif (!Number.isInteger(index) || index < 0) {\n\t\t\t\tthrow new GraphValidationError(\n\t\t\t\t\t`Edge ${edge.from} → ${edge.to} has slot index ${index}; slot indices are non-negative integers`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (index > MAX_SLOT_INDEX) {\n\t\t\t\tthrow new GraphValidationError(\n\t\t\t\t\t`Edge ${edge.from} → ${edge.to} has slot index ${index}; slot indices above ${MAX_SLOT_INDEX} are not supported yet`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO(CAT-2874): multi-slot outputs arrive with branching; until then only\n\t// output slot 0 fires, and the runtime can assume single-slot outputs.\n\tfor (const edge of graph.edges) {\n\t\tif (edge.outputIndex !== 0) {\n\t\t\tthrow new UnimplementedError(\n\t\t\t\t`Edge ${edge.from} → ${edge.to} leaves output slot ${edge.outputIndex}; only output slot 0 is supported yet`,\n\t\t\t);\n\t\t}\n\t}\n\n\t// TODO(CAT-3982): same-slot convergence gets a defined meaning (concatenation);\n\t// until then it is rejected rather than given accidental semantics.","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/engine/src/graph/validate-executable-graph.ts#L29-L65","documentation":"GraphValidationError (code: invalid_graph) thrown by validateExecutableGraph when an edge's outputIndex or inputIndex is a valid non-negative integer but exceeds MAX_SLOT_INDEX. Slot counts above the current cap are not yet supported (see CAT-3042 for raising the bound); the message names the edge, the value, and the current MAX_SLOT_INDEX.","triggerScenarios":"Submitting a graph where a node claims to connect to input/output slot N and N > MAX_SLOT_INDEX. Both indices are checked per edge after the non-negative-integer check.","commonSituations":"A workflow exported from a future version that supports more slots; programmatically generated slot indices that overshoot; a node type designed for branching with many outputs before branching support landed (CAT-2874); off-by-one producing an index one past the cap.","solutions":["Clamp indices to <= MAX_SLOT_INDEX when constructing graphs; check the current value of MAX_SLOT_INDEX for your build.","Redesign high-fan-out nodes to use a different primitive until branching/multi-slot lands (CAT-2874).","If the graph originated from a newer n8n, downgrade the graph structure or upgrade the engine to a build with a higher MAX_SLOT_INDEX.","Validate client-side: `if (index > MAX_SLOT_INDEX) throw ...` with a clearer producer-side message."],"exampleFix":"// before\nedges: [{ from: 'A', to: 'B', outputIndex: 99, inputIndex: 0, isBackEdge: false }]\n\n// after\nedges: [{ from: 'A', to: 'B', outputIndex: 0, inputIndex: 0, isBackEdge: false }]","handlingStrategy":"validation","validationCode":"import { MAX_SLOT_INDEX } from '@n8n/engine/...';\nfunction withinSlotCap(n: number): boolean {\n  return Number.isInteger(n) && n >= 0 && n <= MAX_SLOT_INDEX;\n}\nfor (const e of graph.edges) {\n  if (!withinSlotCap(e.outputIndex) || !withinSlotCap(e.inputIndex)) {\n    // refuse to submit; reduce slot fan-out\n  }\n}","typeGuard":"function isValidSlotIndex(n: unknown): n is number {\n  return typeof n === 'number' && Number.isInteger(n) && n >= 0 && n <= MAX_SLOT_INDEX;\n}","tryCatchPattern":"try {\n  validateExecutableGraph(graph);\n} catch (err) {\n  if (err instanceof GraphValidationError && /slot indices above .* are not supported yet/.test(err.message)) {\n    // clamp the named edge's index to <= MAX_SLOT_INDEX and retry\n  } else throw err;\n}","preventionTips":["Clamp generated slot indices to MAX_SLOT_INDEX for your build.","Avoid high-fan-out designs until branching support (CAT-2874) lands.","Track CAT-3042 for a higher cap; re-validate graphs after upgrades."],"tags":["graph","validation","slots","unimplemented","engine"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}