{"record":{"id":"d9ef283ea8ab730b","repo":"apache/dolphinscheduler","slug":"the-workflowdefinition-should-be-online-d9ef28","errorCode":null,"errorMessage":"The workflowDefinition should be online","messagePattern":"The workflowDefinition should be online","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/TriggerWorkflowDTOValidator.java","lineNumber":53,"sourceCode":"\n    private final StartParamListValidator startParamListValidator;\n\n    public TriggerWorkflowDTOValidator(TenantExistValidator tenantExistValidator,\n                                       StartParamListValidator startParamListValidator) {\n        this.tenantExistValidator = tenantExistValidator;\n        this.startParamListValidator = startParamListValidator;\n    }\n\n    @Override\n    public void validate(final TriggerWorkflowDTO triggerWorkflowDTO) {\n        if (triggerWorkflowDTO.getExecType() != CommandType.START_PROCESS) {\n            throw new IllegalArgumentException(\"The execType should be START_PROCESS\");\n        }\n        if (triggerWorkflowDTO.getWorkflowDefinition() == null) {\n            throw new IllegalArgumentException(\"The workflowDefinition should not be null\");\n        }\n        if (triggerWorkflowDTO.getWorkflowDefinition().getReleaseState() != ReleaseState.ONLINE) {\n            throw new IllegalStateException(\"The workflowDefinition should be online\");\n        }\n\n        tenantExistValidator.validate(triggerWorkflowDTO.getTenantCode());\n\n        startParamListValidator.validate(triggerWorkflowDTO.getStartParamList());\n    }\n}\n","sourceCodeStart":35,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/TriggerWorkflowDTOValidator.java#L35-L61","documentation":"TriggerWorkflowDTOValidator.validate() refuses to build a trigger for a workflow definition whose release state is not ONLINE. DolphinScheduler only allows starting/triggerring runs of workflow definitions that have been published (released); a draft or offline workflow cannot be executed. This is an IllegalStateException because the request itself is well-formed but the workflow is in a state that forbids execution.","triggerScenarios":"Calling the workflow trigger/start API (or the scheduler-internal path that validates TriggerWorkflowDTO) while the target workflow definition's releaseState is OFFLINE or DRAFT, typically via POST /dolphinscheduler/workflows/{code}/trigger or startProcessInstance with an offline definition.","commonSituations":"Users attempt to run a workflow they created but never clicked 'Release'/'Online'; a workflow was taken offline for editing while scheduled or manual triggers still reference it; automation scripts hit an old definition that was later taken offline.","solutions":["Open the workflow in the DolphinScheduler UI and click 'Release' (set ReleaseState to ONLINE), or call the release API to publish the definition before triggering.","Verify via the API (GET workflow definition) that releaseState == ONLINE for the code you are triggering; if a different version is offline, release the correct one.","If the workflow was intentionally taken offline, stop/disable the schedules or automation that trigger it, or re-create/re-release a new version."],"exampleFix":"// before (definition is draft/offline)\ntriggerWorkflowDefinition(definitionCode);\n\n// after: release the definition first\nWorkflowDefinition def = queryDefinition(definitionCode);\nif (def.getReleaseState() != ReleaseState.ONLINE) {\n    workflowDefinitionService.releaseDefinition(loginUser, definitionCode, ReleaseState.ONLINE);\n}\ntriggerWorkflowDefinition(definitionCode);","handlingStrategy":"validation","validationCode":"WorkflowDefinition def = triggerWorkflowDTO.getWorkflowDefinition();\nif (def == null || def.getReleaseState() != ReleaseState.ONLINE) {\n    throw new IllegalStateException(\"Workflow \" + def.getCode() + \" is not ONLINE; release it before triggering\");\n}","typeGuard":"boolean isTriggerable(WorkflowDefinition def) {\n    return def != null && def.getReleaseState() == ReleaseState.ONLINE;\n}","tryCatchPattern":null,"preventionTips":["Always check releaseState in the UI/API before triggering or scheduling a workflow.","Automate release as part of your deployment pipeline for workflow definitions.","When taking a workflow offline, first disable its schedules and dependent automation."],"tags":["workflow","validation","release-state","scheduler"],"backgroundTag":"invalid-state-transition","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}