{"record":{"id":"a9174e96cb4acd4e","repo":"alibaba/spring-ai-alibaba","slug":"failed-to-create-subgraph-action-for-path-starting","errorCode":null,"errorMessage":"Failed to create subgraph action for path starting at: ","messagePattern":"Failed to create subgraph action for path starting at: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/internal/ParallelEdgeProcessor.java","lineNumber":216,"sourceCode":"\t\t\tList<AsyncNodeActionWithConfig> subGraphActions = new ArrayList<>();\n\t\t\tList<String> subGraphNodeIds = new ArrayList<>();\n\n\t\t\tfor (ParallelPath path : paths) {\n\t\t\t\t// Create subgraph for this single path\n\t\t\t\tStateGraph subStateGraph = createSubgraphForPath(path);\n\n\t\t\t\t// Compile the subgraph into CompiledGraph\n\t\t\t\tCompiledGraph subCompiledGraph = subStateGraph.compile(compileConfig);\n\n\t\t\t\t// Create SubCompiledGraphNode for this path\n\t\t\t\tString subGraphNodeId = format(\"__PARALLEL_SUBGRAPH__(%s->%s)\", sourceNodeId, path.startNodeId);\n\t\t\t\tvar subGraphNode = new SubCompiledGraphNode(subGraphNodeId, subCompiledGraph);\n\n\t\t\t\t// Collect actions and node IDs for ParallelNode\n\t\t\t\ttry {\n\t\t\t\t\tsubGraphActions.add(subGraphNode.actionFactory().apply(compileConfig));\n\t\t\t\t} catch (GraphStateException ex) {\n\t\t\t\t\tthrow new RuntimeException(\"Failed to create subgraph action for path starting at: \"\n\t\t\t\t\t\t\t+ path.startNodeId + \". Cause: \" + ex.getMessage(), ex);\n\t\t\t\t}\n\t\t\t\tsubGraphNodeIds.add(subGraphNodeId);\n\t\t\t}\n\n\t\t\t// Create a ParallelNode that executes all subgraphs in parallel\n\t\t\tvar parallelNode = new ParallelNode(sourceNodeId, convergenceNodeId, subGraphActions, subGraphNodeIds,\n\t\t\t\t\tkeyStrategyMap, compileConfig);\n\n\t\t\tnodeFactoriesUpdater.accept(parallelNode.id(), parallelNode.actionFactory());\n\t\t\tedgesUpdater.accept(sourceNodeId, new EdgeValue(parallelNode.id()));\n\t\t\tedgesUpdater.accept(parallelNode.id(), new EdgeValue(convergenceNodeId));\n\t\t} else {\n\t\t\t// Simple case: A->B->Z, A->C->Z - use ParallelNode\n\t\t\tvar targetList = validTargets;\n\n\t\t\tvar actions = targetList.stream()\n\t\t\t\t\t.map(target -> {","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/internal/ParallelEdgeProcessor.java#L198-L234","documentation":"When compiling advanced parallel edges, ParallelEdgeProcessor builds a subgraph action for each path via subGraphNode.actionFactory().apply(compileConfig). If the action factory raises a GraphStateException, it is rethrown as a RuntimeException with this message and the starting node id of the path.","triggerScenarios":"An async action factory for a subgraph node invoked with the current CompileConfig throws GraphStateException — typically a node in the subgraph references a missing node id, an invalid edge, or an unresolvable condition mapping during action creation.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped GraphStateException cause for the exact subgraph node/validation error.","Check that every path starting at the reported startNodeId targets nodes that exist in the compiled graph.","Validate edge definitions (Edges/EdgesEnum) for the parallel branch before compiling.","Ensure the CompileConfig passed to the action factory matches the subgraph's requirements (saver, recursion limit)."],"exampleFix":"// before: branch routes to undefined node\n.addEdge(\"fork\", EdgesEnum.to(\"analizer\"));\n// after: correct node id\n.addEdge(\"fork\", EdgesEnum.to(\"analyzer\"));","handlingStrategy":"validation","validationCode":"// Validate branch targets before compiling the StateGraph\nfor (String targetId : branchTargetIds) {\n    if (!graph.nodes().containsKey(targetId)) throw new IllegalStateException(\"Undefined node: \" + targetId);\n}","typeGuard":null,"tryCatchPattern":"try { compiled = graph.compile(config); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Failed to create subgraph action\")) { /* fix branch defined at reported startNodeId */ } }","preventionTips":["Every parallel branch edge must target a registered node","Compile subgraphs with a consistent CompileConfig","Run graph.compile() early in app startup to fail fast","Validate edge condition mappings reference existing nodes"],"tags":["parallel-execution","subgraph","compile-time","graph-state"],"backgroundTag":"invalid-state-transition","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"}