{"record":{"id":"a4adaef0903a35e8","repo":"apache/dolphinscheduler","slug":"1400004-a4adae","errorCode":"1400004","errorMessage":"description is too long error","messagePattern":"description is too long error","errorType":"validation","errorClass":"ServiceException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java","lineNumber":251,"sourceCode":"    public WorkflowDefinition createWorkflowDefinition(User loginUser,\n                                                       long projectCode,\n                                                       String name,\n                                                       String description,\n                                                       String globalParams,\n                                                       String locations,\n                                                       int timeout,\n                                                       String taskRelationJson,\n                                                       String taskDefinitionJson,\n                                                       String otherParamsJson,\n                                                       WorkflowExecutionTypeEnum executionType) {\n        Project project = projectDao.queryByCode(projectCode);\n\n        // check if user have write perm for project\n        projectService.checkHasProjectWritePermissionThrowException(loginUser, project);\n\n        if (checkDescriptionLength(description)) {\n            log.warn(\"Parameter description is too long.\");\n            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);\n        }\n        // check whether the new workflow definition name exist\n        WorkflowDefinition definition = workflowDefinitionDao.verifyByDefineName(project.getCode(), name);\n        if (definition != null) {\n            log.warn(\"workflow definition with the same name {} already exists, workflowDefinitionCode:{}.\",\n                    definition.getName(), definition.getCode());\n            throw new ServiceException(Status.WORKFLOW_DEFINITION_NAME_EXIST, name);\n        }\n\n        globalParamsValidator.validate(globalParams);\n\n        List<TaskDefinitionLog> taskDefinitionLogs = generateTaskDefinitionList(taskDefinitionJson);\n        List<WorkflowTaskRelationLog> taskRelationList = generateTaskRelationList(taskRelationJson, taskDefinitionLogs);\n\n        long workflowDefinitionCode = CodeGenerateUtils.genCode();\n        WorkflowDefinition workflowDefinition =\n                new WorkflowDefinition(projectCode, name, workflowDefinitionCode, description,\n                        globalParams, locations, timeout, loginUser.getId());","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java#L233-L269","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Shorten the description to within the limit (<=200 characters by default).","Move the long documentation into a linked external doc or into workflow-level local params and keep a brief summary in description.","If the deployment truly needs longer descriptions, adjust the description length limit configuration and restart."],"exampleFix":"// before\ncreateWorkflowDefinition(..., description: IntStream.range(0,300).mapToObj(i->\"x\")...);\n// after\ncreateWorkflowDefinition(..., description: \" nightly ETL for user events \".substring within 200 chars);","handlingStrategy":"validation","validationCode":"int limit = 200; // default description limit\nboolean ok = description == null || description.length() <= limit;","typeGuard":null,"tryCatchPattern":"try {\n    workflowDefinitionService.createWorkflowDefinition(...);\n} catch (ServiceException e) {\n    if (e.getCode() == 1400004) { /* truncate description and retry */ }\n    else throw e;\n}","preventionTips":["Enforce a client-side maxlength (200 chars) on description inputs.","Truncate descriptions programmatically before API calls in import tooling.","Link long docs externally instead of embedding them in the description."],"tags":["workflow-definition","description","length-limit","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}