{"record":{"id":"1ef4d1a5ea7ec843","repo":"iflytek/astron-agent","slug":"no-workflow","errorCode":"NO_WORKFLOW","errorMessage":"ResponseEnum.NO_WORKFLOW","messagePattern":"ResponseEnum\\.NO_WORKFLOW","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":4709,"sourceCode":"        all.addAll(llm);\n        all.addAll(intent);\n        // all.addAll(vExtractor);\n\n        return all;\n    }\n\n\n    public Object evalPageFirstTime(Long id) {\n        return update(Wrappers.lambdaUpdate(Workflow.class)\n                .eq(Workflow::getId, id)\n                .set(Workflow::getEvalPageFirstTime, false));\n    }\n\n    public Object getInputsType(String flowId) {\n        Workflow workflow = getOne(Wrappers.lambdaQuery(Workflow.class).eq(Workflow::getFlowId, flowId));\n        if (workflow == null) {\n            log.error(\"Flow not found, id=\" + flowId);\n            throw new BusinessException(ResponseEnum.NO_WORKFLOW);\n        }\n\n        String data = workflow.getData();\n        if (StringUtils.isBlank(data)) {\n            log.error(\"Workflow protocol is empty, id=\" + flowId);\n            throw new BusinessException(ResponseEnum.WORKFLOW_PROTOCOL_EMPTY);\n        }\n\n        BizWorkflowData bizWorkflowData = JSON.parseObject(data, BizWorkflowData.class);\n        List<BizWorkflowNode> nodes = bizWorkflowData.getNodes();\n        for (BizWorkflowNode node : nodes) {\n            if (node.getId().startsWith(WorkflowConst.NodeType.START)) {\n                // Parse input\n                List<BizInputOutput> outputs = node.getData().getOutputs();\n                return JsonConverter.flowInputTypeConvert(JSON.toJSONString(outputs));\n            }\n        }\n","sourceCodeStart":4691,"sourceCodeEnd":4727,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java#L4691-L4727","documentation":"NO_WORKFLOW (distinct from WORKFLOW_NOT_EXIST) is thrown by getInputsType when no workflow row matches the given flowId via the flowId equality query. The service logs 'Flow not found' with the id and fails fast rather than returning null inputs.","triggerScenarios":"Calling getInputsType(flowId) with a flowId string that matches no row — typo'd id, flowId from a deleted workflow, flowId from another environment/tenant, or duplicated rows making getOne behavior ambiguous/returning null on no match.","commonSituations":"Client storing flowIds after workflows were deleted; cross-environment configuration pointing at the wrong DB; case/whitespace mismatch in the flowId string; tenant isolation filtering out the row.","solutions":["Verify the flowId exists in the workflow table (query eq flow_id, deleted=false) before calling; list workflows in the space to find the correct one","Fix the client/config that supplies the flowId (trim/normalize the string, use the id returned at creation time)","If the workflow was deleted, recreate it or use a still-existing flowId","Catch BusinessException code NO_WORKFLOW and return 404 'flow not found' including the flowId for debugging"],"exampleFix":"// before\nservice.getInputsType(\"wf-abc\"); // typo -> throws NO_WORKFLOW\n// after\nWorkflow wf = workflowService.getOne(Wrappers.lambdaQuery(Workflow.class)\n        .eq(Workflow::getFlowId, \"wf-abc\").eq(Workflow::getDeleted, false));\nif (wf == null) {\n    throw new BusinessException(ResponseEnum.NO_WORKFLOW);\n}\nservice.getInputsType(\"wf-abc\");","handlingStrategy":"validation","validationCode":"Workflow wf = workflowService.getOne(Wrappers.lambdaQuery(Workflow.class)\n        .eq(Workflow::getFlowId, flowId).eq(Workflow::getDeleted, false));\nif (wf == null) { throw new BusinessException(ResponseEnum.NO_WORKFLOW); }","typeGuard":"boolean flowExists(String flowId) { return flowId != null && !flowId.isBlank()\n        && workflowService.getOne(Wrappers.lambdaQuery(Workflow.class).eq(Workflow::getFlowId, flowId)) != null; }","tryCatchPattern":"try { service.getInputsType(flowId); } catch (BusinessException e) { if (code==NO_WORKFLOW) { /* 404 with flowId */ } else throw e; }","preventionTips":["Use the exact flowId returned when the workflow was created (trim/normalize case)","Resolve flowIds against the same environment/tenant as the caller","Purge client caches when workflows are deleted so stale flowIds are not reused"],"tags":["not-found","workflow","flow-id"],"backgroundTag":"record-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}