conductor-oss/conductor · error · NotFoundException

No such task by name %s

Error message

No such task by name %s

What it means

Thrown by MetadataServiceImpl.updateTaskDef when attempting to update a TaskDef whose name does not match any existing TaskDef in the metadata store. The method looks up the existing definition by name; if none is found, it throws NotFoundException (HTTP 404). You cannot update a task definition that has not been registered first.

Source

Thrown at core/src/main/java/com/netflix/conductor/service/MetadataServiceImpl.java:86

            taskDefinition.setUpdateTime(null);

            metadataDAO.createTaskDef(taskDefinition);
            metadataChangeListener.onTaskDefRegistered(taskDefinition);
        }
    }

    @Override
    public void validateWorkflowDef(WorkflowDef workflowDef) {
        // do nothing, WorkflowDef is annotated with @Valid and calling this method will validate it
    }

    /**
     * @param taskDefinition Task Definition to be updated
     */
    public void updateTaskDef(TaskDef taskDefinition) {
        TaskDef existing = metadataDAO.getTaskDef(taskDefinition.getName());
        if (existing == null) {
            throw new NotFoundException("No such task by name %s", taskDefinition.getName());
        }
        taskDefinition.setUpdatedBy(WorkflowContext.get().getClientApp());
        taskDefinition.setUpdateTime(System.currentTimeMillis());
        taskDefinition.setCreateTime(existing.getCreateTime());
        taskDefinition.setCreatedBy(existing.getCreatedBy());
        metadataDAO.updateTaskDef(taskDefinition);
        metadataChangeListener.onTaskDefUpdated(taskDefinition);
    }

    /**
     * @param taskType Remove task definition
     */
    public void unregisterTaskDef(String taskType) {
        metadataDAO.removeTaskDef(taskType);
        metadataChangeListener.onTaskDefUnregistered(taskType);
    }

    /**

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Register the TaskDef first using POST /api/metadata/taskdefs before attempting to update it.
  2. Verify the TaskDef name in the request matches an existing registered name exactly (case-sensitive).
  3. Check if the TaskDef was recently deleted or unregistered via unregisterTaskDef.
  4. If the intent is to create a new TaskDef, use POST instead of PUT.

Example fix

// before — trying to update a non-existent task def
PUT /api/metadata/taskdefs
{"name":"nonexistent_task","retryCount":5}
// 404: No such task by name nonexistent_task

// after — register first, then update
POST /api/metadata/taskdefs
[{"name":"nonexistent_task","retryCount":3}]
// then update
PUT /api/metadata/taskdefs
{"name":"nonexistent_task","retryCount":5}
Defensive patterns

Strategy: validation

Validate before calling

// Check task def existence before updating
TaskDef existing = metadataDAO.getTaskDef(taskDefinition.getName());
if (existing == null) {
    // Use create (POST) instead of update (PUT)
    metadataService.registerTaskDef(List.of(taskDefinition));
} else {
    metadataService.updateTaskDef(taskDefinition);
}

Try / catch

try {
    metadataService.updateTaskDef(taskDefinition);
} catch (NotFoundException e) {
    // TaskDef doesn't exist — create it instead
    LOGGER.info("TaskDef '{}' not found, creating instead", taskDefinition.getName());
    metadataService.registerTaskDef(List.of(taskDefinition));
}

Prevention

When it happens

Trigger: Calling the task definition update API (PUT /api/metadata/taskdefs) with a TaskDef whose name doesn't exist in the metadata DAO. Also when updating by a different name than what was registered, or after the TaskDef was deleted.

Common situations: Trying to update a TaskDef that was never registered (should use POST to create instead of PUT to update). The TaskDef was deleted in another environment. Name mismatch between the request body's name field and the registered task name (case-sensitive). Race condition where the TaskDef was unregistered between a read and the update call.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/3caabcf56b28e93c. Report an issue: GitHub.