{"record":{"id":"85fbed16b48168d4","repo":"apache/dolphinscheduler","slug":"workflow-definition-not-release","errorCode":"WORKFLOW_DEFINITION_NOT_RELEASE","errorMessage":"WORKFLOW_DEFINITION_NOT_RELEASE","messagePattern":"WORKFLOW_DEFINITION_NOT_RELEASE","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java","lineNumber":174,"sourceCode":"        return executorClient.backfillWorkflowDefinition().execute(backfillWorkflowDTO);\n    }\n\n    /**\n     * check whether the workflow definition can be executed\n     *\n     * @param projectCode       project code\n     * @param workflowDefinition workflow definition\n     */\n    @Override\n    public void checkWorkflowDefinitionValid(long projectCode, WorkflowDefinition workflowDefinition,\n                                             long workflowDefinitionCode, Integer version) {\n        // check workflow definition exists\n        if (projectCode != workflowDefinition.getProjectCode()) {\n            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_EXIST, workflowDefinition.getCode());\n        }\n        // check workflow definition online\n        if (workflowDefinition.getReleaseState() != ReleaseState.ONLINE) {\n            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_RELEASE, workflowDefinition.getCode(),\n                    workflowDefinition.getVersion());\n        }\n        // check sub workflow definition online\n        if (!checkSubWorkflowDefinitionValid(workflowDefinition)) {\n            throw new ServiceException(Status.SUB_WORKFLOW_DEFINITION_NOT_RELEASE);\n        }\n    }\n\n    /**\n     * check whether the current workflow has sub workflows and validate all sub workflows\n     *\n     * @param workflowDefinition\n     * @return check result\n     */\n    @Override\n    public boolean checkSubWorkflowDefinitionValid(WorkflowDefinition workflowDefinition) {\n        // query all sub workflows under the current workflow\n        List<WorkflowTaskRelation> workflowTaskRelations =","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java#L156-L192","documentation":"WORKFLOW_DEFINITION_NOT_RELEASE is thrown when the target workflow definition exists in the project but its releaseState is not ONLINE. The scheduler only executes workflows that are online/released, so starting an offline (draft or deprecated) workflow is rejected.","triggerScenarios":"Calling executeTask for a workflow whose releaseState is OFFLINE; attempting to run a newly created but never released workflow; running a workflow that was taken offline (e.g. by delete-export flow or explicit offline operation).","commonSituations":"Creating a workflow in the UI and trying to start it without clicking 'release/online'; a CI pipeline referencing a workflow someone recently took offline for editing; after import, workflows import in offline state.","solutions":["Release the workflow: set its release state to ONLINE via the UI or the workflow-definition release API.","Then retry the execution request.","If the workflow is intentionally offline, point the pipeline at a released workflow.","Check for concurrent editors who took the workflow offline."],"exampleFix":"// before\nstartWorkflow(code); // fails: workflow offline\n// after\nworkflowDefinitionService.releaseWorkflowDefinition(loginUser, projectCode, code, ReleaseState.ONLINE);\nstartWorkflow(code);","handlingStrategy":"validation","validationCode":"if (wf.getReleaseState() != ReleaseState.ONLINE) { /* block start, prompt to release */ }","typeGuard":"boolean isOnline(WorkflowDefinition wf) { return wf != null && wf.getReleaseState() == ReleaseState.ONLINE; }","tryCatchPattern":"try { executeTask(...); } catch (ServiceException e) { if (e.getCode() == Status.WORKFLOW_DEFINITION_NOT_RELEASE) { releaseDefinition(projectCode, code); retry(); } else throw e; }","preventionTips":["Release workflows to ONLINE before scheduling/CI runs.","Include a release step in deployment pipelines before triggering executions.","Monitor workflows that get taken offline by editors."],"tags":["workflow","release-state","dolphinscheduler"],"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-14T00:17:10.932Z"}