{"record":{"id":"d2b6ae9baf98d5a5","repo":"iflytek/astron-agent","slug":"workflow-version-get-name-failed","errorCode":"WORKFLOW_VERSION_GET_NAME_FAILED","errorMessage":"WORKFLOW_VERSION_GET_NAME_FAILED","messagePattern":"WORKFLOW_VERSION_GET_NAME_FAILED","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/ReleaseManageClientServiceImpl.java","lineNumber":37,"sourceCode":"/**\n * @author yun-zhi-ztl\n */\n@Service\n@Slf4j\n@RequiredArgsConstructor\npublic class ReleaseManageClientServiceImpl implements ReleaseManageClientService {\n\n    private final UserLangChainDataService userLangChainDataService;\n    private final VersionService versionService;\n\n    private static final String RELEASE_SUCCESS = WorkflowConst.PublishResult.SUCCESS;\n\n    @Override\n    public String getVersionNameByBotId(Long botId, Long spaceId, HttpServletRequest request) {\n        String flowId = userLangChainDataService.findFlowIdByBotId(botId.intValue());\n        if (StrUtil.isBlank(flowId)) {\n            log.error(\"getVersionNameByBotId - Failed to get flowId by botId, botId={}\", botId);\n            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_GET_NAME_FAILED);\n        }\n\n        WorkflowVersion query = new WorkflowVersion();\n        query.setFlowId(flowId);\n        ApiResult<JSONObject> response = versionService.getVersionNameForBoundBotPublish(query);\n        JSONObject data = response == null ? null : response.data();\n        String versionName = data == null ? null : data.getString(\"workflowVersionName\");\n        if (response == null || response.code() != 0 || StrUtil.isBlank(versionName)) {\n            log.error(\"getVersionNameByBotId - Failed to get version name, botId={}, flowId={}, spaceId={}\",\n                    botId, flowId, spaceId);\n            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_GET_NAME_FAILED);\n        }\n        return versionName;\n    }\n\n    @Override\n    public void releaseBotApi(Integer botId, String flowId, String versionName, String executionUid,\n            Long spaceId, HttpServletRequest request) {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/ReleaseManageClientServiceImpl.java#L19-L55","documentation":"WORKFLOW_VERSION_GET_NAME_FAILED is thrown by ReleaseManageClientServiceImpl.getVersionNameByBotId when no workflow flowId can be found for the given botId. The bot-to-flow binding lookup (userLangChainDataService.findFlowIdByBotId) returned blank.","triggerScenarios":"getVersionNameByBotId called with a botId that has no bound workflow flowId (findFlowIdByBotId returns null/empty).","commonSituations":"Publishing a bot that was never linked to a workflow; binding row missing or deleted; botId passed is wrong or from another space; data migration dropped the bot-flow mapping.","solutions":["Verify the bot is actually bound to a workflow (check the bot-flow binding data used by userLangChainDataService)","Confirm the botId is correct and belongs to the expected space","Re-create the workflow binding for the bot, then retry the release","Check findFlowIdByBotId's numeric conversion (botId.intValue()) isn't overflowing/truncating large ids"],"exampleFix":"// before\nString name = releaseManageClientService.getVersionNameByBotId(botId, spaceId, request);\n// after\nString flowId = userLangChainDataService.findFlowIdByBotId(botId.intValue());\nif (StrUtil.isBlank(flowId)) {\n    throw new BusinessException(ResponseEnum.PARAMETER_ERROR); // clearer client-facing error\n}\nString name = releaseManageClientService.getVersionNameByBotId(botId, spaceId, request);","handlingStrategy":"validation","validationCode":"String flowId = userLangChainDataService.findFlowIdByBotId(botId.intValue()); if (StrUtil.isBlank(flowId)) { /* block release: bot has no bound workflow */ }","typeGuard":null,"tryCatchPattern":"try { name = client.getVersionNameByBotId(botId, spaceId, req); } catch (BusinessException e) { ui.show(\"Bind this bot to a workflow before releasing\"); }","preventionTips":["Enforce bot-to-workflow binding as a prerequisite step in the publish wizard","Validate the binding exists before showing the release button","Watch for Long-to-int truncation on large botIds"],"tags":["workflow","binding","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}