{"record":{"id":"d983d42bded01294","repo":"iflytek/astron-agent","slug":"8125-work-flow-dls-upload-failed-d983d4","errorCode":"8125","errorMessage":"work.flow.dls.upload.failed","messagePattern":"work\\.flow\\.dls\\.upload\\.failed","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowExportService.java","lineNumber":245,"sourceCode":"        String flowName = generateNameWithTimestamp(name);\n        wf.setName(flowName);\n        wf.setAppId(commonConfig.getAppId());\n        wf.setDescription((String) meta.get(\"description\"));\n        wf.setAvatarIcon((String) meta.get(\"avatarIcon\"));\n        wf.setAvatarColor((String) meta.get(\"avatarColor\"));\n        wf.setEdgeType((String) meta.get(\"edgeType\"));\n        wf.setCategory(meta.get(\"category\") instanceof Number category\n                ? category.intValue()\n                : null);\n        wf.setAdvancedConfig(stringValue(meta.get(\"advancedConfig\")));\n        return wf;\n    }\n\n    private BizWorkflowData convertImportedWorkflowData(Map<String, Object> flow) {\n        try {\n            return objectMapper.convertValue(flow, BizWorkflowData.class);\n        } catch (IllegalArgumentException e) {\n            throw invalidWorkflowDsl(e);\n        }\n    }\n\n    private ApiResult<WorkflowImportResponse> persistImportedWorkflow(\n            Workflow wf, WorkflowImportReport report) {\n        wf.setCreateTime(new Date());\n        wf.setUpdateTime(new Date());\n        if (wf.getSource() == null) {\n            wf.setSource(0);\n        }\n        if (StringUtils.isBlank(wf.getAvatarColor())) {\n            wf.setAvatarColor(\"#FFEAD5\");\n        }\n        if (StringUtils.isBlank(wf.getAvatarIcon())) {\n            wf.setAvatarIcon(\"icon/common/emojiitem_00_10@2x.png\");\n        }\n        // All local writes participate in importWorkflowFromYaml's transaction.\n        Long spaceId = SpaceInfoUtil.getSpaceId();","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowExportService.java#L227-L263","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Look at the logged cause (invalidWorkflowDsl(e) logs e.getMessage()) — Jackson's message names the exact mismatching property and expected type.","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.","If the DSL evolved, add/update the mapping (e.g. @JsonIgnoreProperties(ignoreUnknown=true) on BizWorkflowData or a custom deserializer) so older exports keep importing."],"exampleFix":"// before\nflow:\n  nodes:\n    1: \"start\"\n// after\nflow:\n  nodes:\n    - id: \"1\"\n      type: start\n      config: {}","handlingStrategy":"validation","validationCode":"const flow = parsed.flow;\nif (!Array.isArray(flow.nodes)) throw new Error('flow.nodes must be a list');\nfor (const n of flow.nodes) {\n  if (typeof n.id !== 'string' || typeof n.type !== 'string') throw new Error('bad node shape');\n  if (n.config != null && typeof n.config !== 'object') throw new Error('node.config must be an object');\n}","typeGuard":"function isValidBizFlow(flow) {\n  return flow != null && typeof flow === 'object'\n    && Array.isArray(flow.nodes)\n    && flow.nodes.every(n => n && typeof n === 'object' && typeof n.id === 'string');\n}","tryCatchPattern":"try {\n    return workflowExportService.importWorkflowFromYaml(in, request);\n} catch (BusinessException e) {\n    if (e.getCode() == 8125) log.warn(\"flow does not match BizWorkflowData; see Jackson cause in logs\");\n    throw e;\n}","preventionTips":["Generate client-side DTO validation from BizWorkflowData so field types stay in sync.","Annotate BizWorkflowData with @JsonIgnoreProperties(ignoreUnknown = true) for forward compatibility.","Run export→import round-trip tests whenever the DSL schema changes."],"tags":["workflow","jackson","deserialization","yaml-import"],"backgroundTag":"json-unmarshal-failed","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"}