iflytek/astron-agent · error · BusinessException

WORKFLOW_PROTOCOL_LENGTH_LIMIT

WORKFLOW_PROTOCOL_LENGTH_LIMIT

Error message

ResponseEnum.WORKFLOW_PROTOCOL_LENGTH_LIMIT

What it means

Thrown when the JSON-serialized workflow protocol data exceeds CommonConst.MEDIUM_TEXT_BYTES_LIMIT in UTF-8 bytes. The workflow data column (MEDIUMTEXT-sized) cannot hold the payload, so the service rejects the write to avoid truncation or DB errors.

Solutions

  1. Reduce workflow size: delete unneeded nodes/edges or split into multiple workflows
  2. Remove large embedded payloads (base64 assets, pasted text) from node configs
  3. Check the serialized size client-side and warn before hitting the limit
  4. Ask the operator to raise MEDIUM_TEXT_BYTES_LIMIT / column size if the platform genuinely needs bigger flows
Defensive patterns

Strategy: validation

Validate before calling

int size = JSON.toJSONString(data).getBytes(StandardCharsets.UTF_8).length; if (size > CommonConst.MEDIUM_TEXT_BYTES_LIMIT) { /* trim or split */ }

Prevention

When it happens

Trigger: Saving a very large workflow graph: hundreds of nodes/edges, large embedded configurations or pasted content inside node configs; import of an oversized workflow JSON.

Common situations: Users building extremely large flows or duplicating nodes until the payload exceeds the limit; embedding base64 assets in node configs; migrating flows from other tools that carry bloated metadata.

Understand the failure class

Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.

Related errors


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

Appendix: source

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

                    "update advancedConfig failed, originalBytes = {}, updateBytes = {}, errorType = {}",
                    originalBytes,
                    updateBytes,
                    ex.getClass().getSimpleName());
            throw new BusinessException(ResponseEnum.WORKFLOW_HIGH_PARAM_FAILED);
        }
    }

    // ========== 4. Write protocol data (including validation and length limits) ==========
    private void writeProtocolDataIfPresent(Workflow workflow, BizWorkflowData bizWorkflowData) {
        if (bizWorkflowData == null) {
            return;
        }
        if (CollectionUtils.isEmpty(bizWorkflowData.getNodes())) {
            throw new BusinessException(ResponseEnum.WORKFLOW_PROTOCOL_NODE_INFO_CANNOT_EMPTY);
        }
        String dataString = JSON.toJSONString(bizWorkflowData);
        if (dataString.getBytes(StandardCharsets.UTF_8).length > CommonConst.MEDIUM_TEXT_BYTES_LIMIT) {
            throw new BusinessException(ResponseEnum.WORKFLOW_PROTOCOL_LENGTH_LIMIT);
        }
        String old = workflow.getData();
        if (StringUtils.isNotEmpty(old)) {
            JSONObject dataInfo = JSON.parseObject(old);
            dataInfo.put("nodes", bizWorkflowData.getNodes());
            dataInfo.put("edges", bizWorkflowData.getEdges());
            workflow.setData(JSON.toJSONString(dataInfo));
        } else {
            workflow.setData(dataString);
        }
    }

    // ========== 5. SSRF/URL validation ==========
    private void validateSsrfForNodes(BizWorkflowData bizWorkflowData) {
        SsrfProperties ssrfProps = new SsrfProperties();
        ssrfProps.setIpBlaklist(loadIpRules(IP_BLACKLIST_CATEGORY));
        ssrfProps.setIpWhitelist(loadIpRules(IP_WHITELIST_CATEGORY));
        SsrfParamGuard ssrfGuard = new SsrfParamGuard(ssrfProps);

View on GitHub (pinned to 5e758547a8)