apache/dolphinscheduler · error · java.lang.RuntimeException

The dependent task's workflow is not exist, dependentItem: $

Error message

The dependent task's workflow is not exist, dependentItem: ${dependentItem}

What it means

After validating the project, initializeDependentTaskList checks each dependent item's definitionCode against the loaded workflow definition map; a missing WorkflowDefinition means the referenced workflow was deleted or is invisible to this scheduler, so a RuntimeException is thrown and the dependent task cannot run.

Source

Thrown at dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/dependent/DependentTaskTracker.java:169

        taskDefinitionMap = taskDefinitionDao.queryByCodes(taskDefinitionCodes).stream()
                .collect(Collectors.toMap(TaskDefinition::getCode, Function.identity()));
        final TaskInstance taskInstance =
                taskInstanceDao.queryById(taskExecutionContext.getTaskInstanceId());
        List<DependentExecute> dependentExecutes = dependTaskList
                .stream()
                .map(dependentTaskModel -> {
                    for (DependentItem dependentItem : dependentTaskModel.getDependItemList()) {
                        Project project = projectCodeMap.get(dependentItem.getProjectCode());
                        if (project == null) {
                            log.error("The dependent task's project is not exist, dependentItem: {}", dependentItem);
                            throw new RuntimeException(
                                    "The dependent task's project is not exist, dependentItem: " + dependentItem);
                        }
                        WorkflowDefinition workflowDefinition =
                                processDefinitionMap.get(dependentItem.getDefinitionCode());
                        if (workflowDefinition == null) {
                            log.error("The dependent task's workflow is not exist, dependentItem: {}", dependentItem);
                            throw new RuntimeException(
                                    "The dependent task's workflow is not exist, dependentItem: " + dependentItem);
                        }
                        if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_ALL_TASK_CODE) {
                            log.info(
                                    "Add dependent all task, ProjectName: {}, WorkflowName: {}, WorkflowCode: {}, DependentCycle: {}, DependentCycleDate: {}, DependentRelation: {}",
                                    project.getName(), workflowDefinition.getName(), workflowDefinition.getCode(),
                                    dependentItem.getCycle(), dependentItem.getDateValue(),
                                    dependentTaskModel.getRelation());
                        } else if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_WORKFLOW_CODE) {
                            log.info(
                                    "Add dependent workflow task, ProjectName: {}, WorkflowName: {}, WorkflowCode: {}, DependentCycle: {}, DependentCycleDate: {}, DependentRelation: {}",
                                    project.getName(), workflowDefinition.getName(), workflowDefinition.getCode(),
                                    dependentItem.getCycle(), dependentItem.getDateValue(),
                                    dependentTaskModel.getRelation());
                        } else {
                            TaskDefinition taskDefinition = taskDefinitionMap.get(dependentItem.getDepTaskCode());
                            if (taskDefinition == null) {
                                log.error("The dependent task's taskDefinition is not exist, dependentItem: {}",

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Open each dependent task and remove/replace the dependency pointing at the deleted workflow
  2. Recreate the missing workflow if it was deleted accidentally
  3. Check t_ds_process_definition for the definitionCode to verify whether it exists or was soft-deleted

Example fix

// before: dependentItem references definitionCode 111 (workflow deleted)
// after: update the dependent task to point at an existing workflow's definitionCode
Defensive patterns

Strategy: validation

Validate before calling

if (processDefinitionDao.find_by_code(item.getDefinitionCode()) == null) {
    // dependent workflow missing — alert before scheduling
}

Try / catch

try {
    tracker.initializeDependentTaskList();
} catch (RuntimeException e) {
    if (e.getMessage().contains("workflow is not exist")) {
        taskFailed("Dependent workflow deleted");
    }
}

Prevention

When it happens

Trigger: A dependent item's workflow (definitionCode) no longer exists in processDefinitionMap — the workflow was deleted, the dependency was never updated, or the definition belongs to another project not loaded.

Common situations: Deleting a workflow that downstream dependent tasks reference, moving workflows between projects, or DB cleanup scripts removing definitions still referenced by dependent tasks.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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