iflytek/astron-agent · error · BusinessException
8125
8125
Error message
work.flow.dls.upload.failed
What it means
Thrown by WorkflowYamlParser.parse when the uploaded file parses as YAML but the root is not a mapping, or the root map is missing the required top-level 'flowMeta' or 'flowData' keys. A valid workflow DSL export must be a YAML mapping containing both keys; anything else is rejected as an invalid workflow DSL.
Solutions
- Ensure the file root is a mapping containing both 'flowMeta' and 'flowData' keys
- Re-export the workflow from the platform instead of reconstructing the file
- Restore the deleted top-level key if it was removed during editing
- Confirm the uploaded file is the plain workflow YAML export
Example fix
// before (missing flowMeta)\nflowData:\n nodes: []\n// after\nflowMeta:\n name: my workflow\n version: 1\nflowData:\n nodes: []
Defensive patterns
Strategy: validation
Validate before calling
const yaml = require('js-yaml');\nfunction validateWorkflowYaml(text) {\n const root = yaml.load(text);\n if (root == null || typeof root !== 'object' || Array.isArray(root)) throw new Error('root must be a map');\n for (const k of ['flowMeta','flowData']) if (!(k in root)) throw new Error(`missing ${k}`);\n} Type guard
function isWorkflowRoot(root) {\n return root != null && typeof root === 'object' && !Array.isArray(root)\n && 'flowMeta' in root && 'flowData' in root;\n} Try / catch
try {\n const root = yaml.load(text);\n if (!isWorkflowRoot(root)) throw new Error('missing flowMeta/flowData');\n} catch (e) {\n showUserFriendlyError('The uploaded file is not a valid workflow export.');\n} Prevention
- Upload only files exported by the platform
- Validate YAML syntax before uploading
- Never rename or remove top-level flowMeta/flowData keys
When it happens
Trigger: Uploading a YAML whose root is a list or scalar, or a valid YAML missing the flowMeta or flowData top-level section.
Common situations: Uploading a partial YAML that only contains flowData; renaming or deleting top-level keys during editing; concatenating exports so the root becomes a list; uploading a config file instead of a workflow export.
Related errors
- WORKFLOW_IMPORT_FAILED
- 8113
- import workflow rejected, filename=
- WORKFLOW_DLS_UPLOAD_FAILED
- UPDATE_BOT_FAILED
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/66d36882bd2c2ff2.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowYamlParser.java:33
import java.util.List;
import java.util.Map;
/** Loads and validates the portable structure of an imported workflow YAML document. */
@Slf4j
final class WorkflowYamlParser {
private static final int MAX_YAML_ALIASES = 50;
private static final int MAX_YAML_NESTING_DEPTH = 50;
private static final int MAX_YAML_CODE_POINTS = 20 * 1024 * 1024;
private WorkflowYamlParser() {}
static ParsedWorkflowDsl parse(InputStream inputStream) {
Object loaded;
try {
LoaderOptions loaderOptions = createLoaderOptions();
loaded = new Yaml(new SafeConstructor(loaderOptions)).load(inputStream);
} catch (YAMLException | ClassCastException e) {
throw invalidWorkflowDsl(e);
}
if (!(loaded instanceof Map<?, ?> rootMap)) {
throw invalidWorkflowDsl(null);
}
Map<String, Object> root = toStringKeyMap(rootMap);
if (!root.containsKey("flowMeta") || !root.containsKey("flowData")) {
throw invalidWorkflowDsl(null);
}
if (!(root.get("flowMeta") instanceof Map<?, ?> metaRaw)
|| !(root.get("flowData") instanceof Map<?, ?> flowRaw)) {
throw invalidWorkflowDsl(null);
}
Map<String, Object> meta = toStringKeyMap(metaRaw);
Map<String, Object> flow = toStringKeyMap(flowRaw);
validateWorkflowMetaShape(meta);
validateWorkflowDslShape(flow);
return new ParsedWorkflowDsl(meta, flow, root.get("dependencyManifest"));
}View on GitHub (pinned to 5e758547a8)