iflytek/astron-agent · error · BusinessException

8110

8110

Error message

workflow.not.exist

What it means

Thrown by VersionService.requireWorkflow when no live (deleted=false) workflow row matches the given flowId. Signals the workflow referenced by the request does not exist or has been logically deleted (code 8110).

Solutions

  1. Confirm the flowId exists: SELECT * FROM workflow WHERE flow_id = ? AND deleted = 0
  2. Re-fetch the workflow list from the UI/API instead of caching an old flowId
  3. Check you are operating in the correct space/tenant (SpaceInfoUtil space context)
  4. If the workflow was deleted, recreate it or restore it rather than retrying version operations

Example fix

// before
versionService.createVersion(dtoWithStaleFlowId);
// after
Workflow wf = workflowMapper.selectOne(new LambdaQueryWrapper<Workflow>()
        .eq(Workflow::getFlowId, flowId).eq(Workflow::getDeleted, false));
if (wf == null) { throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST); }
versionService.createVersion(dto);
Defensive patterns

Strategy: validation

Validate before calling

Workflow wf = workflowMapper.selectOne(new LambdaQueryWrapper<Workflow>()
        .eq(Workflow::getFlowId, flowId).eq(Workflow::getDeleted, false));
boolean exists = wf != null;

Type guard

boolean workflowExists(String flowId) {
    return workflowMapper.selectCount(new LambdaQueryWrapper<Workflow>()
        .eq(Workflow::getFlowId, flowId).eq(Workflow::getDeleted, false)) > 0;
}

Try / catch

try {
    return serviceMethodRequiringWorkflow(flowId);
} catch (BusinessException e) {
    if ("workflow.not.exist".equals(e.getMessage())) { return notFoundResponse(flowId); }
    throw e;
}

Prevention

When it happens

Trigger: Any service method that resolves a workflow by flowId (e.g. version operations calling requireWorkflow) with a flowId that is absent from the workflow table or whose row has deleted=true.

Common situations: Caller passes a stale flowId after the workflow was deleted; typo'd or fabricated flowId from client; cross-space request where the workflow belongs to another space; race with a concurrent logical delete.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

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

            workflowVersionMapper.insert(workflowVersion);

            return ApiResult.success(new JSONObject()
                    .fluentPut("workflowVersionId", workflowVersion.getId())
                    .fluentPut("workflowVersionName", createDto.getName()));
        } catch (BusinessException e) {
            throw e;
        } catch (Exception e) {
            throw new BusinessException(ResponseEnum.WORKFLOW_VERSION_ADD_FAILED);
        }
        //
    }

    private Workflow requireWorkflow(String flowId) {
        Workflow workflow = workflowMapper.selectOne(Wrappers.lambdaQuery(Workflow.class)
                .eq(Workflow::getFlowId, flowId)
                .eq(Workflow::getDeleted, false));
        if (workflow == null || Boolean.TRUE.equals(workflow.getDeleted())) {
            throw new BusinessException(ResponseEnum.WORKFLOW_NOT_EXIST);
        }
        return workflow;
    }

    /**
     * Update isVersion flag for all versions of a specific flowId. Sets all versions' isVersion to 2
     * (inactive) for the given flowId.
     *
     * @param flowId Flow ID to update versions for
     */
    public void updateIsVersionForFlowId(String flowId) {
        // Build update conditions
        LambdaUpdateWrapper<WorkflowVersion> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(WorkflowVersion::getFlowId, flowId)
                .eq(WorkflowVersion::getIsVersion, 1)
                .set(WorkflowVersion::getIsVersion, 2);
        // Execute update
        workflowVersionMapper.update(null, updateWrapper);

View on GitHub (pinned to 5e758547a8)