{"record":{"id":"237e05836d3efe03","repo":"alibaba/spring-ai-alibaba","slug":"workflow-execute-error-237e05","errorCode":"WORKFLOW_EXECUTE_ERROR","errorMessage":"${context.getError().getMessage()}","messagePattern":"\\$\\{context\\.getError\\(\\)\\.getMessage\\(\\)\\}","errorType":"error_code","errorClass":"BizException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/workflow/processor/impl/OutputExecuteProcessor.java","lineNumber":225,"sourceCode":"\t/**\n\t * Check if a node's execution is finished\n\t * @param graph The workflow graph\n\t * @param context The workflow context\n\t * @param nodeId The ID of the node to check\n\t * @return true if the node execution is finished, false otherwise\n\t */\n\tprivate boolean isFinished(DirectedAcyclicGraph<String, Edge> graph, WorkflowContext context, String nodeId) {\n\t\tboolean nodeContain = graph.containsVertex(nodeId);\n\t\tif (!nodeContain) {\n\t\t\treturn true;\n\t\t}\n\t\tNodeResult nodeResult = context.getNodeResultMap().get(nodeId);\n\t\tif (nodeResult == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (context.getTaskStatus().equals(NodeStatusEnum.FAIL.getCode())\n\t\t\t\t|| nodeResult.getNodeStatus().equals(NodeStatusEnum.FAIL.getCode())) {\n\t\t\tthrow new BizException(ErrorCode.WORKFLOW_EXECUTE_ERROR.toError(context.getError().getMessage()));\n\t\t}\n\t\tif (nodeResult.getNodeStatus().equals(NodeStatusEnum.SUCCESS.getCode())\n\t\t\t\t|| nodeResult.getNodeStatus().equals(NodeStatusEnum.SKIP.getCode())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic CheckNodeParamResult checkNodeParam(DirectedAcyclicGraph<String, Edge> graph, Node node) {\n\t\tCheckNodeParamResult result = super.checkNodeParam(graph, node);\n\t\tNodeParam nodeParam = JsonUtils.fromMap(node.getConfig().getNodeParam(), NodeParam.class);\n\t\tif (nodeParam == null) {\n\t\t\tresult.setSuccess(false);\n\t\t\tresult.getErrorInfos().add(\"[nodeParam] is null\");\n\t\t\treturn result;\n\t\t}\n\t\tif (StringUtils.isBlank(nodeParam.getOutput())) {","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/workflow/processor/impl/OutputExecuteProcessor.java#L207-L243","documentation":"In OutputExecuteProcessor, when rendering the output template the engine checks the status of each referenced upstream node (isFinished). If the workflow task or the referenced node ended in FAIL status, the stored error message is rethrown as WORKFLOW_EXECUTE_ERROR so the original failure surfaces at the output node.","triggerScenarios":"An output/text-template node references a variable from an upstream node that failed (or the whole task failed), and handleTextTemplate probes that node's NodeResult; since either taskStatus or nodeStatus is FAIL, context.getError().getMessage() is thrown.","commonSituations":"An LLM or plugin node upstream errored (bad API key, timeout) and the workflow continued to an output node that consumes its variables; workflows where error branches are not configured; retries that keep failing before the output node.","solutions":["Read the propagated message — it is the original upstream node's failure; fix that node first.","Configure failure branches / conditional edges so the output node only runs when upstream nodes succeed.","Add error handling (e.g. exception branch or default values) on the failing upstream node.","Catch BizException WORKFLOW_EXECUTE_ERROR at task level and present the root cause instead of a generic workflow failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for (String nodeId : outputNodeDependencies) {\n    NodeResult r = context.getNodeResultMap().get(nodeId);\n    if (r != null && NodeStatusEnum.FAIL.getCode().equals(r.getNodeStatus())) {\n        throw new IllegalStateException(\"upstream node failed: \" + nodeId);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    workflowExecutor.run(request);\n} catch (BizException e) {\n    if (\"WORKFLOW_EXECUTE_ERROR\".equals(e.getCode())) { /* message is the upstream root cause */ }\n}","preventionTips":["Configure failure/error branches on every node whose output the final template consumes.","Only reference variables from nodes that have succeeded; add conditional edges for optional paths.","Provide default values for template variables so partial failures degrade gracefully."],"tags":["workflow","propagated-error","output-node","node-failure"],"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"}