iflytek/astron-agent · warning · BusinessException

import workflow rejected, filename=

Error message

import workflow rejected, filename={}, code={}

What it means

WorkflowController.importWorkflow logs this warning when workflowExportService.importWorkflowFromYaml throws a BusinessException — the YAML import was rejected by validation with a specific code (e.g. WORKFLOW_DLS_UPLOAD_FAILED, code 8125). The original exception is re-thrown unchanged after logging the filename and code, so the client receives the precise rejection reason.

Solutions

  1. Read the returned `code` in the response: 8125 (WORKFLOW_DLS_UPLOAD_FAILED) means the file was empty, over the size limit, or failed DSL validation — fix the file content/size and retry.
  2. If WORKFLOW_IMPORT_FAILED is returned instead (generic exception), check server logs for the accompanying error stack to find the real parsing failure.
  3. Validate the YAML against a known-good export from the same version before importing; ensure required sections (meta, flow, dependencyManifest) exist and the dependency manifest entry count is within limits.
Defensive patterns

Strategy: validation

Validate before calling

final long MAX_BYTES = 5 * 1024 * 1024; // match MAX_WORKFLOW_IMPORT_BYTES
// client-side pre-check before upload
if (file == null || file.size === 0 || file.size > MAX_BYTES) {
    alert('File is empty or exceeds the workflow import size limit');
}

Try / catch

try {
    await api.importWorkflow(file);
} catch (e) {
    if (e.code === 8125) showError('Invalid workflow DSL: check YAML structure and size');
    else showError('Workflow import failed — see server logs');
}

Prevention

When it happens

Trigger: POSTing a workflow import file where file == null, file.isEmpty(), or file.getSize() > MAX_WORKFLOW_IMPORT_BYTES (throws WORKFLOW_DLS_UPLOAD_FAILED directly), or the YAML parses but fails DSL shape/manifest validation inside the export service.

Common situations: Users uploading oversized or empty files via the workflow import UI; hand-edited workflow YAML missing required meta/flow sections; DSL exported from a newer version parsed by an older backend.

Related errors


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

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/controller/workflow/WorkflowController.java:501

    }

    /**
     * Import workflow from YAML.
     */
    @PostMapping("/import")
    @SpacePreAuth(
            key = "WorkflowController_importWorkflow_POST",
            module = "Workflow",
            point = "Workflow Import",
            description = "Workflow Import")
    public Object importWorkflow(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
        if (file == null || file.isEmpty() || file.getSize() > MAX_WORKFLOW_IMPORT_BYTES) {
            throw new BusinessException(ResponseEnum.WORKFLOW_DLS_UPLOAD_FAILED);
        }
        try (InputStream inputStream = file.getInputStream()) {
            return workflowExportService.importWorkflowFromYaml(inputStream, request);
        } catch (BusinessException e) {
            log.warn("import workflow rejected, filename={}, code={}",
                    file.getOriginalFilename(), e.getCode());
            throw e;
        } catch (Exception e) {
            log.error("import workflow failed, filename={}", file.getOriginalFilename(), e);
            throw new BusinessException(ResponseEnum.WORKFLOW_IMPORT_FAILED);
        }
    }

    // ---------------------- Prompt Comparison (Save/List) ----------------------

    @PostMapping("/save-comparisons")
    public ApiResult<String> saveComparisons(@RequestBody @NotNull List<WorkflowComparisonSaveReq> workflowComparisonReqList) {
        return ApiResult.success(workflowService.saveComparisons(workflowComparisonReqList));
    }

    @GetMapping("/list-comparisons")
    public List<WorkflowComparison> listComparisons(@RequestParam @NotBlank String promptId) {
        return workflowService.listComparisons(promptId);

View on GitHub (pinned to 5e758547a8)