{"record":{"id":"e1864d0b0bf0a508","repo":"iflytek/astron-agent","slug":"bot-not-exist-e1864d","errorCode":"BOT_NOT_EXIST","errorMessage":"BOT_NOT_EXIST","messagePattern":"BOT_NOT_EXIST","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java","lineNumber":5085,"sourceCode":"                workflow.setData(workflow.getData().replace(oldAppId, appId));\n            }\n            if (StringUtils.isNotBlank(workflow.getPublishedData())) {\n                workflow.setPublishedData(workflow.getPublishedData().replace(oldAppId, appId));\n            }\n        }\n        workflow.setAppId(appId);\n        workflow.setUpdateTime(new Date());\n        if (workflowMapper.updateById(workflow) != 1) {\n            throw new BusinessException(ResponseEnum.INTERNAL_SERVER_ERROR);\n        }\n    }\n\n    public Object hasQaNode(Integer botId) {\n        UserLangChainInfo userLangChainInfo = userLangChainInfoDao.selectOne(new LambdaQueryWrapper<UserLangChainInfo>().eq(UserLangChainInfo::getBotId, botId));\n\n        if (Objects.isNull(userLangChainInfo)) {\n            log.error(\"----- Assistant protocol not found, botId: {}\", botId);\n            throw new BusinessException(ResponseEnum.BOT_NOT_EXIST);\n        }\n        String flowId = userLangChainInfo.getFlowId();\n        Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)\n                .eq(Workflow::getFlowId, flowId)\n                .eq(Workflow::getDeleted, false)\n                .last(\"limit 1\"));\n        if (workflow == null) {\n            throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);\n        }\n        dataPermissionCheckTool.checkWorkflowVisible(workflow, SpaceInfoUtil.getSpaceId());\n        Boolean flag = checkFlowHasQaNode(workflow);\n        return ApiResult.success(flag);\n    }\n\n    private static @NotNull Boolean checkFlowHasQaNode(Workflow workflow) {\n        BizWorkflowData bizWorkflowData = JSON.parseObject(workflow.getData(), BizWorkflowData.class);\n        if (bizWorkflowData == null) {\n            return false;","sourceCodeStart":5067,"sourceCodeEnd":5103,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java#L5067-L5103","documentation":"Thrown by WorkflowService.hasQaNode when no UserLangChainInfo record (the assistant protocol binding) exists for the given botId. The service requires a bot-to-flow association before it can look up the workflow and check for QA nodes. BOT_NOT_EXIST signals the botId does not map to any assistant protocol row.","triggerScenarios":"Calling the hasQaNode API with a botId that has no row in the user_lang_chain_info table — e.g. a bot never created through this system, a typo'd/stale botId, or a bot whose protocol record was deleted.","commonSituations":"Client caches a botId from an old environment or another tenant's space; the bot was deleted but a bookmarked URL or scheduled job still references it; passing an internal workflow flowId instead of a botId.","solutions":["Verify the botId exists by querying user_lang_chain_info for that botId before calling hasQaNode.","Confirm you are using the botId (not flowId or bot market id) and are in the correct tenant/space.","Recreate the assistant protocol binding for the bot, or use a botId of an existing bot."],"exampleFix":"// before\nBoolean flag = workflowService.hasQaNode(unknownBotId);\n// after\nUserLangChainInfo info = userLangChainInfoDao.selectOne(\n    new LambdaQueryWrapper<UserLangChainInfo>().eq(UserLangChainInfo::getBotId, botId));\nif (info == null) {\n    throw new BusinessException(ResponseEnum.BOT_NOT_EXIST); // fail fast with same signal\n}\nBoolean flag = workflowService.hasQaNode(botId);","handlingStrategy":"validation","validationCode":"boolean botExists = userLangChainInfoDao.selectCount(\n    new LambdaQueryWrapper<UserLangChainInfo>().eq(UserLangChainInfo::getBotId, botId)) > 0;\nif (!botExists) throw new BusinessException(ResponseEnum.BOT_NOT_EXIST);","typeGuard":"if (botId == null || botId <= 0) { return false; }","tryCatchPattern":"try {\n    Object result = workflowService.hasQaNode(botId);\n} catch (BusinessException e) {\n    if (\"BOT_NOT_EXIST\".equals(e.getCode())) {\n        // show 'bot not found', prompt user to reselect\n    } else { throw e; }\n}","preventionTips":["Always resolve botId from a fresh API list call, never from cached/bookmarked values.","Confirm the bot belongs to the current space/tenant before querying.","Log the botId with the request so stale references surface quickly."],"tags":["java","workflow","bot","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"}