iflytek/astron-agent · error · BusinessException

PARAM_ERROR

PARAM_ERROR

Error message

PARAM_ERROR

What it means

Thrown by saveComparisons when the batch is invalid: the first item is null, its flowId is blank, or any item in the list is null or has a different flowId. All comparison groups in one save must belong to the same workflow flowId.

Solutions

  1. Ensure every WorkflowComparisonSaveReq in the list has the same non-blank flowId as the first element.
  2. Fix the client so a save batch is built from a single workflow's comparison rows only.
  3. Validate/sanitize the payload before sending: drop null items and check flowId equality.

Example fix

// before
List<WorkflowComparisonSaveReq> mixed = List.of(a, bFromOtherFlow);
workflowService.saveComparisons(mixed);
// after
String flowId = a.getFlowId();
List<WorkflowComparisonSaveReq> clean = reqList.stream()
    .filter(Objects::nonNull)
    .filter(r -> StringUtils.isNotBlank(r.getFlowId()) && r.getFlowId().equals(flowId))
    .collect(Collectors.toList());
workflowService.saveComparisons(clean);
Defensive patterns

Strategy: validation

Validate before calling

Set<String> flowIds = reqList.stream()
    .filter(Objects::nonNull)
    .map(WorkflowComparisonSaveReq::getFlowId)
    .filter(StringUtils::isNotBlank)
    .collect(Collectors.toSet());
if (flowIds.size() != 1) throw new BusinessException(ResponseEnum.PARAM_ERROR);

Type guard

boolean singleFlow = list != null && !list.isEmpty() && list.stream().allMatch(r -> r != null
    && StringUtils.isNotBlank(r.getFlowId())
    && r.getFlowId().equals(list.get(0).getFlowId()));

Try / catch

try {
    workflowService.saveComparisons(reqList);
} catch (BusinessException e) {
    if ("PARAM_ERROR".equals(e.getCode())) {
        // rebuild the batch from a single workflow's rows
    } else { throw e; }
}

Prevention

When it happens

Trigger: Submitting a comparison batch where entries carry inconsistent flowIds (e.g. merging rows from two workflows), passing null elements in the JSON array, or omitting flowId on the first item.

Common situations: Client-side state mixing rows from a previous edit session; copy-paste of comparison rows between workflows; malformed request payload where flowId is missing on some items.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

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

            return "moonshot";
        }
        if (domain.contains("doubao")) {
            return "doubao";
        }
        return StringUtils.isBlank(llmInfoVo.getUrl()) ? "xinghuo" : "openai";
    }

    public String saveComparisons(List<WorkflowComparisonSaveReq> workflowComparisonReqList) {
        if (workflowComparisonReqList == null || workflowComparisonReqList.isEmpty()) {
            throw new BusinessException(ResponseEnum.PROMPT_GROUP_PROMPT_CANNOT_EMPTY);
        }

        WorkflowComparisonSaveReq first = workflowComparisonReqList.getFirst();
        if (first == null || StringUtils.isBlank(first.getFlowId())
                || workflowComparisonReqList.stream()
                        .anyMatch(item -> item == null
                                || !StringUtils.equals(first.getFlowId(), item.getFlowId()))) {
            throw new BusinessException(ResponseEnum.PARAM_ERROR);
        }

        final String flowIdForLog = first.getFlowId();

        try {
            requireOwnedWorkflow(flowIdForLog);

            workflowComparisonMapper.delete(
                    Wrappers.lambdaQuery(WorkflowComparison.class)
                            .eq(WorkflowComparison::getFlowId, flowIdForLog));

            Date now = new Date();
            for (WorkflowComparisonSaveReq data : workflowComparisonReqList) {
                WorkflowComparison wc = new WorkflowComparison();
                wc.setFlowId(data.getFlowId());
                wc.setType(data.getType());
                wc.setPromptId(data.getPromptId());
                wc.setData(JSONObject.toJSONString(data.getData()));

View on GitHub (pinned to 5e758547a8)