iflytek/astron-agent · warning

Parse workflow inputs failed, workflowId=

Error message

Parse workflow inputs failed, workflowId={}

What it means

extractWorkflowInputs walks the workflow's node graph to find the start node's outputs schema. Parsing/inspecting that structure is wrapped in a broad try-catch: on any exception (malformed JSON in node data, unexpected graph shape, nulls) it logs a warning with the workflowId and returns an empty list, so skill export proceeds without declared inputs.

Solutions

  1. Inspect the logged stack trace to find whether JSON parsing or graph traversal failed, then fix the workflow definition in the DB or via the editor
  2. Re-save/re-publish the workflow so its definition is re-serialized with the current schema
  3. Add schema validation on workflow import/save to reject malformed definitions early
  4. If inputs are optional for the skill, accepting the empty-list fallback is fine; otherwise make this throw
Defensive patterns

Strategy: try-catch

Validate before calling

// validate workflow definition is parseable before export
try {
    JsonNode def = objectMapper.readTree(workflow.getDefinition());
    if (!def.hasNonNull("nodes")) throw new IllegalArgumentException("Workflow has no nodes");
} catch (JsonProcessingException e) {
    throw new IllegalArgumentException("Workflow definition is not valid JSON, fix before export");
}

Type guard

boolean hasStartOutputs(Workflow wf) {
    return wf != null && wf.getNodes() != null && wf.getNodes().stream()
        .anyMatch(n -> n != null && n.getData() != null && n.getData().getOutputs() != null);
}

Try / catch

try {
    return extractWorkflowInputs(workflow);
} catch (Exception e) {
    log.warn("Parse workflow inputs failed, workflowId={}", workflow.getId(), e);
    return List.of(); // or rethrow if inputs are mandatory
}

Prevention

When it happens

Trigger: inputs() -> extractWorkflowInputs on a workflow whose definition JSON cannot be parsed or whose start-node data.outputs is missing/malformed — e.g. corrupt stored definition, nodes serialized by an older schema version, or hand-edited workflow data.

Common situations: Workflows imported from other environments with schema drift; definitions saved before an inputs/outputs schema change; manual DB edits breaking the JSON; DSL import from an incompatible astron version.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowSkillExportServiceImpl.java:110

        if (StringUtils.isBlank(workflowProtocol)) {
            return List.of();
        }

        try {
            BizWorkflowData workflowData = JSON.parseObject(workflowProtocol, BizWorkflowData.class);
            if (workflowData == null || workflowData.getNodes() == null) {
                return List.of();
            }
            for (BizWorkflowNode node : workflowData.getNodes()) {
                if (node != null
                        && StringUtils.startsWith(node.getId(), WorkflowConst.NodeType.START)
                        && node.getData() != null
                        && node.getData().getOutputs() != null) {
                    return node.getData().getOutputs();
                }
            }
        } catch (Exception e) {
            log.warn("Parse workflow inputs failed, workflowId={}", workflow.getId(), e);
        }
        return List.of();
    }

    private SkillMetadata generateSkillMetadata(String workflowName, String workflowDescription, Long workflowId) {
        SkillMetadata fallback = new SkillMetadata(
                toSkillName(workflowName, workflowId),
                toFallbackDescription(workflowName, workflowDescription),
                false);

        try {
            String prompt = buildMetadataPrompt(workflowName, workflowDescription);
            String content = CompletableFuture
                    .supplyAsync(() -> openAiModelProcessService.processNonStreaming(prompt))
                    .orTimeout(METADATA_GENERATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)
                    .exceptionally(ex -> {
                        log.warn("Generate workflow skill metadata failed, workflowId={}", workflowId, ex);
                        return null;

View on GitHub (pinned to 5e758547a8)