apache/dolphinscheduler · warning · ServiceException

1400004

1400004

Error message

description is too long error

What it means

Thrown by createWorkflowDefinition (and update paths) when checkDescriptionLength reports that the workflow description exceeds the configured maximum length (default 200 chars, limit set by DESCR_LIMIT_LENGTH). The API rejects the create request rather than truncating.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:251

    public WorkflowDefinition createWorkflowDefinition(User loginUser,
                                                       long projectCode,
                                                       String name,
                                                       String description,
                                                       String globalParams,
                                                       String locations,
                                                       int timeout,
                                                       String taskRelationJson,
                                                       String taskDefinitionJson,
                                                       String otherParamsJson,
                                                       WorkflowExecutionTypeEnum executionType) {
        Project project = projectDao.queryByCode(projectCode);

        // check if user have write perm for project
        projectService.checkHasProjectWritePermissionThrowException(loginUser, project);

        if (checkDescriptionLength(description)) {
            log.warn("Parameter description is too long.");
            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
        }
        // check whether the new workflow definition name exist
        WorkflowDefinition definition = workflowDefinitionDao.verifyByDefineName(project.getCode(), name);
        if (definition != null) {
            log.warn("workflow definition with the same name {} already exists, workflowDefinitionCode:{}.",
                    definition.getName(), definition.getCode());
            throw new ServiceException(Status.WORKFLOW_DEFINITION_NAME_EXIST, name);
        }

        globalParamsValidator.validate(globalParams);

        List<TaskDefinitionLog> taskDefinitionLogs = generateTaskDefinitionList(taskDefinitionJson);
        List<WorkflowTaskRelationLog> taskRelationList = generateTaskRelationList(taskRelationJson, taskDefinitionLogs);

        long workflowDefinitionCode = CodeGenerateUtils.genCode();
        WorkflowDefinition workflowDefinition =
                new WorkflowDefinition(projectCode, name, workflowDefinitionCode, description,
                        globalParams, locations, timeout, loginUser.getId());

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Shorten the description to within the limit (<=200 characters by default).
  2. Move the long documentation into a linked external doc or into workflow-level local params and keep a brief summary in description.
  3. If the deployment truly needs longer descriptions, adjust the description length limit configuration and restart.

Example fix

// before
createWorkflowDefinition(..., description: IntStream.range(0,300).mapToObj(i->"x")...);
// after
createWorkflowDefinition(..., description: " nightly ETL for user events ".substring within 200 chars);
Defensive patterns

Strategy: validation

Validate before calling

int limit = 200; // default description limit
boolean ok = description == null || description.length() <= limit;

Try / catch

try {
    workflowDefinitionService.createWorkflowDefinition(...);
} catch (ServiceException e) {
    if (e.getCode() == 1400004) { /* truncate description and retry */ }
    else throw e;
}

Prevention

When it happens

Trigger: POST /projects/{code}/workflow-definition with a description string longer than the limit, or creating a workflow via UI with a very long pasted description.

Common situations: Pasting multi-paragraph documentation into the description field; programmatic import from another system with long metadata; migrating workflows that allowed longer descriptions in another tool.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/a4adaef0903a35e8. Report an issue: GitHub.