iflytek/astron-agent · error · BusinessException

WORKFLOW_VERSION_PUBLISH_FAILED

WORKFLOW_VERSION_PUBLISH_FAILED

Error message

WORKFLOW_VERSION_PUBLISH_FAILED

What it means

WORKFLOW_VERSION_PUBLISH_FAILED is thrown when releasing a bot API fails validation of the publish request. In releaseBotApi it is thrown when required parameters (botId, flowId, versionName) are missing or blank. It signals the workflow version could not even be initiated because the request was malformed.

Solutions

  1. Check that botId, flowId and versionName are all non-null and non-blank before calling releaseBotApi
  2. Verify the publish request payload from the client includes all three fields
  3. Trace upstream to the controller that invokes releaseBotApi and log the incoming request

Example fix

// before
releaseBotApi(null, "", "v1", uid, spaceId, request);
// after
if (botId != null && StrUtil.isNotBlank(flowId) && StrUtil.isNotBlank(versionName)) {
    releaseBotApi(botId, flowId, versionName, uid, spaceId, request);
}
Defensive patterns

Strategy: validation

Validate before calling

if (botId == null || flowId == null || flowId.isBlank() || versionName == null || versionName.isBlank()) { throw new IllegalArgumentException("botId, flowId and versionName are required"); }

Try / catch

try { releaseBotApi(botId, flowId, versionName, uid, spaceId, request); } catch (BusinessException e) { if ("WORKFLOW_VERSION_PUBLISH_FAILED".equals(e.getMessage())) { /* show field-required validation error */ } }

Prevention

When it happens

Trigger: Calling releaseBotApi with a null botId, an empty/whitespace flowId, or an empty/whitespace versionName.

Common situations: Frontend submit buttons that post incomplete publish forms; API integrations omitting versionName; deserialization dropping null/blank fields; bots created without a bound flow.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/ReleaseManageClientServiceImpl.java:57

        WorkflowVersion query = new WorkflowVersion();
        query.setFlowId(flowId);
        ApiResult<JSONObject> response = versionService.getVersionNameForBoundBotPublish(query);
        JSONObject data = response == null ? null : response.data();
        String versionName = data == null ? null : data.getString("workflowVersionName");
        if (response == null || response.code() != 0 || StrUtil.isBlank(versionName)) {
            log.error("getVersionNameByBotId - Failed to get version name, botId={}, flowId={}, spaceId={}",
                    botId, flowId, spaceId);
            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_GET_NAME_FAILED);
        }
        return versionName;
    }

    @Override
    public void releaseBotApi(Integer botId, String flowId, String versionName, String executionUid,
            Long spaceId, HttpServletRequest request) {
        if (botId == null || StrUtil.isBlank(flowId) || StrUtil.isBlank(versionName)) {
            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_PUBLISH_FAILED);
        }
        String boundFlowId = userLangChainDataService.findFlowIdByBotId(botId);
        if (!StrUtil.equals(boundFlowId, flowId)) {
            log.error("releaseBotApi - FlowId does not match bot binding, botId={}, flowId={}, boundFlowId={}",
                    botId, flowId, boundFlowId);
            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_PUBLISH_FAILED);
        }

        WorkflowVersion workflowVersion = new WorkflowVersion();
        workflowVersion.setBotId(botId.toString());
        workflowVersion.setFlowId(flowId);
        workflowVersion.setPublishChannel(Long.valueOf(ReleaseTypeEnum.BOT_API.getCode()));
        workflowVersion.setPublishResult(RELEASE_SUCCESS);
        workflowVersion.setDescription("");
        workflowVersion.setName(versionName);

        ApiResult<JSONObject> response = versionService.createForBoundBotPublish(
                workflowVersion, executionUid, spaceId);

View on GitHub (pinned to 5e758547a8)