iflytek/astron-agent · error · BusinessException

8125

8125

Error message

work.flow.dls.upload.failed

What it means

WorkflowExportService.convertImportedWorkflowData maps the parsed YAML `flow` map onto BizWorkflowData via Jackson objectMapper.convertValue. When the map does not fit BizWorkflowData (unknown/missing fields, wrong value types — IllegalArgumentException from Jackson), invalidWorkflowDsl(e) throws BusinessException WORKFLOW_DLS_UPLOAD_FAILED (code 8125, message key work.flow.dls.upload.failed).

Solutions

  1. Look at the logged cause (invalidWorkflowDsl(e) logs e.getMessage()) — Jackson's message names the exact mismatching property and expected type.
  2. Fix the YAML so `flow` matches BizWorkflowData: nodes must be a list of node objects with the expected id/type/config types; correct any string-vs-object values.
  3. If the DSL evolved, add/update the mapping (e.g. @JsonIgnoreProperties(ignoreUnknown=true) on BizWorkflowData or a custom deserializer) so older exports keep importing.

Example fix

// before
flow:
  nodes:
    1: "start"
// after
flow:
  nodes:
    - id: "1"
      type: start
      config: {}
Defensive patterns

Strategy: validation

Validate before calling

const flow = parsed.flow;
if (!Array.isArray(flow.nodes)) throw new Error('flow.nodes must be a list');
for (const n of flow.nodes) {
  if (typeof n.id !== 'string' || typeof n.type !== 'string') throw new Error('bad node shape');
  if (n.config != null && typeof n.config !== 'object') throw new Error('node.config must be an object');
}

Type guard

function isValidBizFlow(flow) {
  return flow != null && typeof flow === 'object'
    && Array.isArray(flow.nodes)
    && flow.nodes.every(n => n && typeof n === 'object' && typeof n.id === 'string');
}

Try / catch

try {
    return workflowExportService.importWorkflowFromYaml(in, request);
} catch (BusinessException e) {
    if (e.getCode() == 8125) log.warn("flow does not match BizWorkflowData; see Jackson cause in logs");
    throw e;
}

Prevention

When it happens

Trigger: Imported YAML `flow` contains fields whose types don't match BizWorkflowData (e.g. nodes as a map instead of a list, edges as strings), unknown properties with FAIL_ON_UNKNOWN enabled, or a null where a primitive/collection is expected.

Common situations: DSL schema drift between frontend export and backend DTO; manually edited YAML with a typo in a node property type; importing a workflow exported from a newer release with extra fields.

Understand the failure class

Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.

Related errors


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

Appendix: source

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

        String flowName = generateNameWithTimestamp(name);
        wf.setName(flowName);
        wf.setAppId(commonConfig.getAppId());
        wf.setDescription((String) meta.get("description"));
        wf.setAvatarIcon((String) meta.get("avatarIcon"));
        wf.setAvatarColor((String) meta.get("avatarColor"));
        wf.setEdgeType((String) meta.get("edgeType"));
        wf.setCategory(meta.get("category") instanceof Number category
                ? category.intValue()
                : null);
        wf.setAdvancedConfig(stringValue(meta.get("advancedConfig")));
        return wf;
    }

    private BizWorkflowData convertImportedWorkflowData(Map<String, Object> flow) {
        try {
            return objectMapper.convertValue(flow, BizWorkflowData.class);
        } catch (IllegalArgumentException e) {
            throw invalidWorkflowDsl(e);
        }
    }

    private ApiResult<WorkflowImportResponse> persistImportedWorkflow(
            Workflow wf, WorkflowImportReport report) {
        wf.setCreateTime(new Date());
        wf.setUpdateTime(new Date());
        if (wf.getSource() == null) {
            wf.setSource(0);
        }
        if (StringUtils.isBlank(wf.getAvatarColor())) {
            wf.setAvatarColor("#FFEAD5");
        }
        if (StringUtils.isBlank(wf.getAvatarIcon())) {
            wf.setAvatarIcon("icon/common/emojiitem_00_10@2x.png");
        }
        // All local writes participate in importWorkflowFromYaml's transaction.
        Long spaceId = SpaceInfoUtil.getSpaceId();

View on GitHub (pinned to 5e758547a8)