{"record":{"id":"c7b8c5900a1051f5","repo":"alibaba/spring-ai-alibaba","slug":"failed-to-create-node-action-for-nodeid","errorCode":null,"errorMessage":"Failed to create node action for nodeId: ","messagePattern":"Failed to create node action for nodeId: ","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":505,"sourceCode":"\t/**\n\t * Clone state over all state.\n\t * \n\t * @param data the data\n\t * @return the over all state\n\t */\n\tpublic OverAllState cloneState(Map<String, Object> data) throws IOException, ClassNotFoundException {\n\t\treturn new OverAllState(stateGraph.getStateSerializer().cloneObject(data).data(), getKeyStrategyMap());\n\t}\n\n\t/**\n\t * Package-private access to nodes for ReactiveNodeGenerator.\n\t */\n\tpublic AsyncNodeActionWithConfig getNodeAction(String nodeId) {\n\t\tNode.ActionFactory factory = nodeFactories.get(nodeId);\n\t\ttry {\n\t\t\treturn factory != null ? factory.apply(compileConfig) : null;\n\t\t} catch (GraphStateException e) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"Failed to create node action for nodeId: \" + nodeId + \". Cause: \" + e.getMessage(), e);\n\t\t}\n\t}\n\n\t/**\n\t * Package-private access to edges for ReactiveNodeGenerator\n\t */\n\tpublic EdgeValue getEdge(String nodeId) {\n\t\treturn edges.get(nodeId);\n\t}\n\n\t/**\n\t * Package-private access to keyStrategyMap for ReactiveNodeGenerator\n\t */\n\tpublic Map<String, KeyStrategy> getKeyStrategyMap() {\n\t\treturn keyStrategyMap;\n\t}\n","sourceCodeStart":487,"sourceCodeEnd":523,"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#L487-L523","documentation":"getNodeAction looks up a node's ActionFactory and applies it; a GraphStateException raised by the factory is rethrown as a RuntimeException ('Failed to create node action for nodeId: <id>'). The node exists in the graph but its action cannot be constructed under the current compile config.","triggerScenarios":"Calling compiledGraph.getNodeAction(nodeId) (directly or during graph execution) where the node's action factory throws — e.g. subgraph preprocessing failures, invalid state key usage, unresolvable config.","commonSituations":"Nodes wrapping subgraphs that fail ProcessedNodesEdgesAndConfig validation; actions capturing invalid state schemas; calling getNodeAction before dependencies (like a compiled subgraph) are ready.","solutions":["Read the wrapped cause message for the specific validation that failed.","Fix the node action factory so apply(compileConfig) succeeds.","Check nodeId spelling; ensure the node was added with a valid action."],"exampleFix":"// before\nvar action = compiledGraph.getNodeAction(\"mySubGraphNode\"); // subgraph invalid\n// after\n// validate the subgraph compiles standalone first:\nvar subCompiled = subGraph.compile();\nvar action = compiledGraph.getNodeAction(\"mySubGraphNode\");","handlingStrategy":"try-catch","validationCode":"if (!compiled.getGraph().nodes().containsKey(nodeId)) throw new IllegalArgumentException(\"Unknown node: \" + nodeId);","typeGuard":null,"tryCatchPattern":"try { action = compiled.getNodeAction(id); } catch (RuntimeException e) { log.error(\"Node {} action failed: {}\", id, e.getCause().getMessage(), e); }","preventionTips":["Compile subgraphs standalone before embedding them as nodes.","Inspect the wrapped GraphStateException cause — it names the real validation failure.","Avoid calling getNodeAction for nodes whose factories depend on later-initialized state."],"tags":["graph-execution","node-action","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"}