{"record":{"id":"1d18a4ff50313a45","repo":"alibaba/spring-ai-alibaba","slug":"failed-to-create-parallel-node-action-for-target","errorCode":null,"errorMessage":"Failed to create parallel node action for target: ","messagePattern":"Failed to create parallel node action for target: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/CompiledGraph.java","lineNumber":235,"sourceCode":"\n\t\t\t\t\tvar conditionalEdges = parallelNodeEdges.stream()\n\t\t\t\t\t\t\t.filter(ee -> ee.target().value() != null)\n\t\t\t\t\t\t\t.toList();\n\t\t\t\t\tif (!conditionalEdges.isEmpty()) {\n\t\t\t\t\t\tthrow Errors.unsupportedConditionalEdgeOnParallelNode.exception(e.sourceId(),\n\t\t\t\t\t\t\t\tconditionalEdges.stream().map(Edge::sourceId).toList());\n\t\t\t\t\t}\n\t\t\t\t\tthrow Errors.illegalMultipleTargetsOnParallelNode.exception(e.sourceId(), parallelNodeTargets);\n\t\t\t\t}\n\n\t\t\t\tvar targetList = parallelNodeStream.get().toList();\n\n\t\t\t\tvar actions = targetList.stream()\n\t\t\t\t\t\t.map(target -> {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\treturn nodeFactories.get(target.id()).apply(compileConfig);\n\t\t\t\t\t\t\t} catch (GraphStateException ex) {\n\t\t\t\t\t\t\t\tthrow new RuntimeException(\"Failed to create parallel node action for target: \"\n\t\t\t\t\t\t\t\t\t\t+ target.id() + \". Cause: \" + ex.getMessage(), ex);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.toList();\n\n\t\t\t\tvar actionNodeIds = targetList.stream().map(EdgeValue::id).toList();\n\n\t\t\t\tvar targetNodeId = parallelNodeTargets.iterator().next();\n\t\t\t\tvar parallelNode = new ParallelNode(e.sourceId(), targetNodeId, actions, actionNodeIds, keyStrategyMap,\n\t\t\t\t\t\tcompileConfig);\n\n\t\t\t\tnodeFactories.put(parallelNode.id(), parallelNode.actionFactory());\n\n\t\t\t\tedges.put(e.sourceId(), new EdgeValue(parallelNode.id()));\n\n\t\t\t\tedges.put(parallelNode.id(), new EdgeValue(targetNodeId));\n\n\t\t\t}","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/CompiledGraph.java#L217-L253","documentation":"When compiling parallel (fan-out) edges, CompiledGraph instantiates the AsyncNodeActionWithConfig for each parallel target. If a node factory throws GraphStateException, it is rethrown as a RuntimeException ('Failed to create parallel node action for target: <id>') with the original cause.","triggerScenarios":"An error boundary/lifecycle or action factory for a node participating in a parallel branch throws during factory.apply(compileConfig) — e.g. an action whose compile-time checks fail (invalid keys, bad state schema).","commonSituations":"Parallel branches containing nodes with misconfigured actions; subgraphs inside parallel branches failing compile-time validation; node factories that depend on uninitialized config.","solutions":["Read the '. Cause:' message and the wrapped GraphStateException to find the failing node.","Fix the underlying GraphStateException for that node's action (schema/key issues usually).","Test node actions individually before including them in parallel branches."],"exampleFix":"// before\n.addParallelBranch(List.of(\"brokenNode\", \"okNode\"), ...) // brokenNode action throws at compile\n// after\n// fix brokenNode's action so its factory passes compileConfig validation\n.addNode(\"brokenNode\", AsyncNodeAction.node_async(validAction))","handlingStrategy":"try-catch","validationCode":"for (String id : parallelTargets) { assert nodeActionCompiles(id); } // compile each action standalone first","typeGuard":null,"tryCatchPattern":"try { compiled = graph.compile(cfg); } catch (RuntimeException e) { log.error(\"Parallel node {} failed: cause={}\", extractTarget(e), e.getCause(), e); }","preventionTips":["Ensure each node in parallel branches has a factory that succeeds with the same compileConfig.","Test parallel branch graphs in isolation.","Keep action factories free of config-dependent side effects."],"tags":["graph-compile","parallel-node","runtime"],"backgroundTag":"internal-invariant-violation","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}