{"record":{"id":"27d21e6a7707accf","repo":"iflytek/astron-agent","slug":"workflow-not-exist-27d21e","errorCode":"WORKFLOW_NOT_EXIST","errorMessage":"WORKFLOW_NOT_EXIST","messagePattern":"WORKFLOW_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/WorkflowArtifactService.java","lineNumber":409,"sourceCode":"        }\n        if (spaceId != null) {\n            if (spaceUserService.getRole(spaceId, currentUid) == null) {\n                throw new BusinessException(ResponseEnum.INSUFFICIENT_PERMISSIONS);\n            }\n            wrapper.eq(WorkflowArtifact::getSpaceId, spaceId);\n        } else {\n            wrapper.isNull(WorkflowArtifact::getSpaceId)\n                    .eq(WorkflowArtifact::getUid, currentUid);\n        }\n    }\n\n    private void assertWorkflowVisible(Long workflowId) {\n        Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)\n                .eq(Workflow::getId, workflowId)\n                .eq(Workflow::getDeleted, Boolean.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    }\n\n    private void assertWorkflowWritable(Long workflowId) {\n        Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)\n                .eq(Workflow::getId, workflowId)\n                .eq(Workflow::getDeleted, Boolean.FALSE)\n                .last(\"limit 1\"));\n        if (workflow == null) {\n            throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);\n        }\n        assertArtifactScope(\n                workflow,\n                UserInfoManagerHandler.getUserId(),\n                SpaceInfoUtil.getSpaceId());\n    }\n","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowArtifactService.java#L391-L427","documentation":"Thrown by assertWorkflowVisible when no non-deleted Workflow row exists for the given workflowId. This is the console toolkit's artifact-listing/download path rejecting access to a workflow that does not exist (or has been soft-deleted) before the visibility check via dataPermissionCheckTool runs. It is a BusinessException mapped to the WORKFLOW_NOT_EXIST response code.","triggerScenarios":"Calling listArtifacts or getDownloadInfo with a workflowId that was never created, was soft-deleted (deleted=true), or belongs to a different environment/database.","commonSituations":"Stale frontend cache referencing a deleted workflow; calling the artifact API after the workflow was removed by another user; copying a workflowId from another environment (test vs prod); typo'd or truncated ID from logs.","solutions":["Verify the workflowId exists and deleted=false in the workflow table","Refresh the client-side workflow list and retry with a valid ID","Confirm you are pointed at the correct environment/database","Check if the workflow was soft-deleted by a teammate or cleanup job"],"exampleFix":"// before\nservice.getDownloadInfo(12345L); // stale id of deleted workflow\n// after\nWorkflow wf = workflowMapper.selectById(12345L);\nif (wf == null || Boolean.TRUE.equals(wf.getDeleted())) {\n    throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST); // or re-select a valid id\n}","handlingStrategy":"validation","validationCode":"boolean workflowExists(Long id) {\n    return workflowMapper.exists(Wrappers.lambdaQuery(Workflow.class)\n        .eq(Workflow::getId, id).eq(Workflow::getDeleted, Boolean.FALSE));\n}","typeGuard":"if (workflowId == null || !workflowExists(workflowId)) { refreshWorkflowList(); return; }","tryCatchPattern":"try { artifactService.listArtifacts(wfId); } catch (BusinessException e) {\n    if (e.getCode() == ResponseEnum.WORKFLOW_NOT_EXIST) { refreshClientState(); }\n    else throw e;\n}","preventionTips":["Refresh workflow lists after deletions instead of caching ids","Validate the id exists before calling artifact APIs","Watch for soft-delete flags when reusing ids from logs"],"tags":["workflow","not-found","mybatis"],"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"}