{"record":{"id":"f6ea33498aa5a864","repo":"conductor-oss/conductor","slug":"cannot-find-the-task-definitions-for-the-following","errorCode":null,"errorMessage":"Cannot find the task definitions for the following tasks used in workflow: %s","messagePattern":"Cannot find the task definitions for the following tasks used in workflow: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/metadata/MetadataMapperService.java","lineNumber":182,"sourceCode":"        Utils.checkNotNull(workflowDefinition, \"WorkflowDefinition cannot be null\");\n\n        // Obtain the names of the tasks with missing definitions\n        Set<String> missingTaskDefinitionNames =\n                workflowDefinition.collectTasks().stream()\n                        .filter(\n                                workflowTask ->\n                                        workflowTask.getType().equals(TaskType.SIMPLE.name()))\n                        .filter(this::shouldPopulateTaskDefinition)\n                        .map(WorkflowTask::getName)\n                        .collect(Collectors.toSet());\n\n        if (!missingTaskDefinitionNames.isEmpty()) {\n            LOGGER.error(\n                    \"Cannot find the task definitions for the following tasks used in workflow: {}\",\n                    missingTaskDefinitionNames);\n            Monitors.recordWorkflowStartError(\n                    workflowDefinition.getName(), WorkflowContext.get().getClientApp());\n            throw new IllegalArgumentException(\n                    \"Cannot find the task definitions for the following tasks used in workflow: \"\n                            + missingTaskDefinitionNames);\n        }\n    }\n\n    public TaskModel populateTaskWithDefinition(TaskModel task) {\n        Utils.checkNotNull(task, \"Task cannot be null\");\n        populateWorkflowTaskWithDefinition(task.getWorkflowTask());\n        return task;\n    }\n\n    @VisibleForTesting\n    boolean shouldPopulateTaskDefinition(WorkflowTask workflowTask) {\n        Utils.checkNotNull(workflowTask, \"WorkflowTask cannot be null\");\n        Utils.checkNotNull(workflowTask.getType(), \"WorkflowTask type cannot be null\");\n        return workflowTask.getTaskDefinition() == null\n                && StringUtils.isNotBlank(workflowTask.getName());\n    }","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/metadata/MetadataMapperService.java#L164-L200","documentation":"Thrown by MetadataMapperService.checkNotEmptyDefinitions when one or more SIMPLE-type tasks referenced in a workflow definition do not have a corresponding TaskDef registered in the metadata store. Every SIMPLE task must have a TaskDef registered before the workflow can start. System tasks (SIMPLE type excluded) do not require a TaskDef. This is an IllegalArgumentException that prevents the workflow from starting.","triggerScenarios":"Registering or starting a workflow whose definition references SIMPLE tasks by name, but those task names have no TaskDef entry in the metadata DAO. The error fires during populateWorkflowWithDefinitions or populateTaskDefinitions when the workflow definition is being validated.","commonSituations":"Registering a workflow definition before registering the TaskDefs for its SIMPLE tasks. Renaming a TaskDef but not updating the workflow definition. Deleting a TaskDef that is still referenced by a deployed workflow. Environment mismatch — TaskDefs exist in one environment but not another.","solutions":["Register the missing TaskDef(s) using the metadata API: POST /api/metadata/taskdefs with the task definition JSON for each missing name listed in the error.","Verify the task names in the workflow definition exactly match the registered TaskDef names (case-sensitive).","If the task is actually a system task, change its type from SIMPLE to the correct system task type (e.g. HTTP, INLINE, SET_VARIABLE).","Re-register the workflow definition after all TaskDefs are in place."],"exampleFix":"// before — workflow references unregistered task\nPUT /api/metadata/workflow\n{\"name\":\"my_wf\",\"tasks\":[{\"name\":\"missing_task\",\"taskReferenceName\":\"t1\",\"type\":\"SIMPLE\"}]}\n\n// fix — register the task first\nPOST /api/metadata/taskdefs\n[{\"name\":\"missing_task\",\"retryCount\":3,\"timeoutSeconds\":300}]","handlingStrategy":"validation","validationCode":"// Pre-flight check: verify all SIMPLE task names have registered TaskDefs\nSet<String> simpleTaskNames = workflowDef.collectTasks().stream()\n    .filter(wt -> \"SIMPLE\".equals(wt.getType()))\n    .map(WorkflowTask::getName)\n    .collect(Collectors.toSet());\n\nfor (String name : simpleTaskNames) {\n    if (metadataDAO.getTaskDef(name) == null) {\n        throw new IllegalStateException(\n            \"TaskDef '\" + name + \"' is not registered — register it first\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register all TaskDefs before registering or starting the workflow that references them.","Use a deployment script that registers TaskDefs first, then workflow definitions.","Add a CI lint step that checks all SIMPLE task references against registered TaskDefs."],"tags":["metadata","task-definition","workflow-definition","validation"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}