alibaba/spring-ai-alibaba · error · BizException
WORKFLOW_EXECUTE_ERROR
WORKFLOW_EXECUTE_ERROR
Error message
${context.getError().getMessage()} What it means
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.
Source
Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/workflow/processor/impl/OutputExecuteProcessor.java:225
/**
* Check if a node's execution is finished
* @param graph The workflow graph
* @param context The workflow context
* @param nodeId The ID of the node to check
* @return true if the node execution is finished, false otherwise
*/
private boolean isFinished(DirectedAcyclicGraph<String, Edge> graph, WorkflowContext context, String nodeId) {
boolean nodeContain = graph.containsVertex(nodeId);
if (!nodeContain) {
return true;
}
NodeResult nodeResult = context.getNodeResultMap().get(nodeId);
if (nodeResult == null) {
return false;
}
if (context.getTaskStatus().equals(NodeStatusEnum.FAIL.getCode())
|| nodeResult.getNodeStatus().equals(NodeStatusEnum.FAIL.getCode())) {
throw new BizException(ErrorCode.WORKFLOW_EXECUTE_ERROR.toError(context.getError().getMessage()));
}
if (nodeResult.getNodeStatus().equals(NodeStatusEnum.SUCCESS.getCode())
|| nodeResult.getNodeStatus().equals(NodeStatusEnum.SKIP.getCode())) {
return true;
}
return false;
}
@Override
public CheckNodeParamResult checkNodeParam(DirectedAcyclicGraph<String, Edge> graph, Node node) {
CheckNodeParamResult result = super.checkNodeParam(graph, node);
NodeParam nodeParam = JsonUtils.fromMap(node.getConfig().getNodeParam(), NodeParam.class);
if (nodeParam == null) {
result.setSuccess(false);
result.getErrorInfos().add("[nodeParam] is null");
return result;
}
if (StringUtils.isBlank(nodeParam.getOutput())) {View on GitHub (pinned to f82da0b50f)
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.
Defensive patterns
Strategy: try-catch
Validate before calling
for (String nodeId : outputNodeDependencies) {
NodeResult r = context.getNodeResultMap().get(nodeId);
if (r != null && NodeStatusEnum.FAIL.getCode().equals(r.getNodeStatus())) {
throw new IllegalStateException("upstream node failed: " + nodeId);
}
} Try / catch
try {
workflowExecutor.run(request);
} catch (BizException e) {
if ("WORKFLOW_EXECUTE_ERROR".equals(e.getCode())) { /* message is the upstream root cause */ }
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/237e05836d3efe03.
Report an issue: GitHub.