iflytek/astron-agent · error · BusinessException

WORKFLOW_NOT_EXIST

WORKFLOW_NOT_EXIST

Error message

WORKFLOW_NOT_EXIST

What it means

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.

Solutions

  1. Verify the workflowId exists and deleted=false in the workflow table
  2. Refresh the client-side workflow list and retry with a valid ID
  3. Confirm you are pointed at the correct environment/database
  4. Check if the workflow was soft-deleted by a teammate or cleanup job

Example fix

// before
service.getDownloadInfo(12345L); // stale id of deleted workflow
// after
Workflow wf = workflowMapper.selectById(12345L);
if (wf == null || Boolean.TRUE.equals(wf.getDeleted())) {
    throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST); // or re-select a valid id
}
Defensive patterns

Strategy: validation

Validate before calling

boolean workflowExists(Long id) {
    return workflowMapper.exists(Wrappers.lambdaQuery(Workflow.class)
        .eq(Workflow::getId, id).eq(Workflow::getDeleted, Boolean.FALSE));
}

Type guard

if (workflowId == null || !workflowExists(workflowId)) { refreshWorkflowList(); return; }

Try / catch

try { artifactService.listArtifacts(wfId); } catch (BusinessException e) {
    if (e.getCode() == ResponseEnum.WORKFLOW_NOT_EXIST) { refreshClientState(); }
    else throw e;
}

Prevention

When it happens

Trigger: Calling listArtifacts or getDownloadInfo with a workflowId that was never created, was soft-deleted (deleted=true), or belongs to a different environment/database.

Common situations: 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.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowArtifactService.java:409

        }
        if (spaceId != null) {
            if (spaceUserService.getRole(spaceId, currentUid) == null) {
                throw new BusinessException(ResponseEnum.INSUFFICIENT_PERMISSIONS);
            }
            wrapper.eq(WorkflowArtifact::getSpaceId, spaceId);
        } else {
            wrapper.isNull(WorkflowArtifact::getSpaceId)
                    .eq(WorkflowArtifact::getUid, currentUid);
        }
    }

    private void assertWorkflowVisible(Long workflowId) {
        Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)
                .eq(Workflow::getId, workflowId)
                .eq(Workflow::getDeleted, Boolean.FALSE)
                .last("limit 1"));
        if (workflow == null) {
            throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);
        }
        dataPermissionCheckTool.checkWorkflowVisible(workflow, SpaceInfoUtil.getSpaceId());
    }

    private void assertWorkflowWritable(Long workflowId) {
        Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)
                .eq(Workflow::getId, workflowId)
                .eq(Workflow::getDeleted, Boolean.FALSE)
                .last("limit 1"));
        if (workflow == null) {
            throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);
        }
        assertArtifactScope(
                workflow,
                UserInfoManagerHandler.getUserId(),
                SpaceInfoUtil.getSpaceId());
    }

View on GitHub (pinned to 5e758547a8)