{"record":{"id":"aa065dca6c32f67d","repo":"apache/dolphinscheduler","slug":"sub-workflow-definition-not-release","errorCode":"SUB_WORKFLOW_DEFINITION_NOT_RELEASE","errorMessage":"SUB_WORKFLOW_DEFINITION_NOT_RELEASE","messagePattern":"SUB_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":179,"sourceCode":"     *\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 =\n                workflowTaskRelationDao.queryDownstreamByWorkflowDefinitionCode(workflowDefinition.getCode());\n        if (workflowTaskRelations.isEmpty()) {\n            return true;\n        }\n        Set<Long> relationCodes =","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java#L161-L197","documentation":"SUB_WORKFLOW_DEFINITION_NOT_RELEASE is thrown when the target workflow is online but at least one nested sub-workflow referenced by a SUB_PROCESS task is offline. checkSubWorkflowDefinitionValid recursively validates child workflows, and the executor refuses to start a parent whose dependency chain contains an offline sub-workflow.","triggerScenarios":"Executing a workflow containing a SUB_PROCESS task whose sub-workflow definition has releaseState != ONLINE, at any depth of nesting.","commonSituations":"Someone released only the parent workflow but forgot the sub-workflows; a sub-workflow was taken offline for editing while the parent stayed online; newly imported workflows with nested dependencies in offline state.","solutions":["Identify the offline sub-workflow (check all SUB_PROCESS task targets) and release it to ONLINE.","Release every nested sub-workflow in the chain, then retry.","Temporarily inline the sub-workflow logic if the sub-workflow must stay offline."],"exampleFix":"// before: only parent released\nrelease(parentCode);\nexecute(parentCode); // fails\n// after\nrelease(parentCode);\nrelease(subWorkflowCodeFromSubProcessTask);\nexecute(parentCode);","handlingStrategy":"validation","validationCode":"boolean allSubWorkflowsOnline = workflowDefinitionService.querySubWorkflowDefinitions(projectCode, wf.getCode())\n    .stream().allMatch(d -> d.getReleaseState() == ReleaseState.ONLINE);","typeGuard":null,"tryCatchPattern":"try { executeTask(...); } catch (ServiceException e) { if (e.getCode() == Status.SUB_WORKFLOW_DEFINITION_NOT_RELEASE) { /* find and release offline sub-workflow, then retry */ } else throw e; }","preventionTips":["Release parent and all sub-workflows together after edits.","Audit SUB_PROCESS tasks for their target workflow release state before scheduling.","Automate release of dependency chains in deployment scripts."],"tags":["workflow","sub-process","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"}