iflytek/astron-agent · error

WORKFLOW_CALL_FAILED

WORKFLOW_CALL_FAILED

Error message

Workflow call failed.

What it means

AgentWorkflowRuntimeService.runWorkflow (in AgentWorkflowRuntimeService) executes a workflow invocation via the workflow runtime handler; any exception caught in the surrounding try is logged as 'Workflow run failed' with the flowId and converted into error content with code WORKFLOW_CALL_FAILED. The agent receives a controlled error string instead of an exception, indicating the workflow call never produced a usable result.

Solutions

  1. Check the log line 'Workflow run failed, flowId' for errorType to identify the exception class
  2. Verify the core/workflow service is healthy and reachable from the toolkit service
  3. Confirm the flowId exists and has a published/running version
  4. Check HTTP client timeouts against the workflow's expected execution duration
  5. Retry the call for transient failures; return WORKFLOW_CALL_FAILED content to the agent for graceful degradation

Example fix

// before
return errorContent("WORKFLOW_CALL_FAILED", "Workflow call failed.");
// after
if (isTransient(e)) {
    response = toolServiceCallHandler.toolRun(request); // retry once
} else {
    return errorContent("WORKFLOW_CALL_FAILED", "Workflow call failed: " + e.getClass().getSimpleName());
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (flowId == null || flowId.isBlank()) return errorContent("WORKFLOW_CALL_FAILED", "missing flowId");

Try / catch

try { response = handler.run(req); } catch (Exception e) { log.warn("workflow {} failed: {}", flowId, e.getClass().getSimpleName(), e); return errorContent("WORKFLOW_CALL_FAILED", "Workflow call failed."); }

Prevention

When it happens

Trigger: toolServiceCallHandler-style workflow run throws: core/workflow service unreachable, HTTP timeout, non-2xx response, or protocol/serialization exception while invoking the flow identified by definition.getFlowId().

Common situations: core/workflow service down or restarted; workflow version deleted/published incorrectly so the run endpoint 404s or 500s; long-running flow exceeding the HTTP timeout; network policy blocking toolkit→core/workflow traffic.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/9bc4c79f922252c3. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/AgentWorkflowRuntimeService.java:160

        JSONObject body = new JSONObject();
        body.put("flow_id", definition.getFlowId());
        body.put("uid", StringUtils.defaultIfBlank(uid, "agent"));
        body.put("parameters", modelArgs == null ? new JSONObject() : modelArgs);
        body.put("history", new JSONArray());
        body.put("stream", false);

        try {
            String responseBody = workflowChatRunClient.chat(body);
            return extractResult(definition, responseBody);
        } catch (Exception e) {
            log.warn(
                    "Workflow run failed, flowId: {}, errorType: {}",
                    definition.getFlowId(),
                    e.getClass().getSimpleName());
            return errorContent("WORKFLOW_CALL_FAILED", "Workflow call failed.");
        }
    }

    private List<Workflow> selectByFlowIds(List<String> flowIds) {
        List<Workflow> workflows =
                workflowMapper.selectList(new LambdaQueryWrapper<Workflow>().in(Workflow::getFlowId, flowIds));
        if (workflows == null) {
            return List.of();
        }
        return workflows.stream()
                .filter(w -> w != null && !Boolean.TRUE.equals(w.getDeleted()))
                .toList();
    }

    private AgentWorkflowDefinition buildDefinition(Workflow workflow, Set<String> usedNames) {
        String name = StringUtils.trimToEmpty(workflow.getName());
        String description = StringUtils.trimToEmpty(workflow.getDescription());
        String combined = StringUtils.isBlank(description) ? name : name + ": " + description;
        return AgentWorkflowDefinition.builder()
                .flowId(workflow.getFlowId())
                .name(name)

View on GitHub (pinned to 5e758547a8)