flowable/flowable-engine · error · FlowableIllegalArgumentException

taskIds can not be null for bulk update tasks requests

Error message

taskIds can not be null for bulk update tasks requests

What it means

Flowable's REST bulkUpdateTasks endpoint throws FlowableIllegalArgumentException when the BulkTasksRequest body is present but its taskIds collection is null. A bulk update without task ids has no targets, so the request is rejected.

Solutions

  1. Include a non-null taskIds array in the request body, e.g. {"taskIds":["id1","id2"], ...}.
  2. Fix field-name typos so it matches taskIds exactly.
  3. Ensure the client serializer emits empty arrays rather than omitting/nulling the field.
  4. Validate the body client-side before sending (taskIds != null && taskIds.size() > 0).

Example fix

// before
{"action": "complete"}
// after
{"action": "complete", "taskIds": ["1001", "1002"]}
Defensive patterns

Strategy: validation

Validate before calling

if (body.taskIds == null || !Array.isArray(body.taskIds)) {
    throw new Error('taskIds must be a non-null array');
}

Type guard

function hasTaskIds(b) { return Array.isArray(b && b.taskIds); }

Try / catch

try {
    // PUT /runtime/tasks
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().includes('taskIds can not be null')) {
        // populate taskIds and retry
    } else throw e;
}

Prevention

When it happens

Trigger: PUT /runtime/tasks with a JSON body that omits the taskIds field or explicitly sets it to null.

Common situations: Renamed/mispelled JSON field (e.g. "ids" instead of "taskIds"), client DTO serialization dropping empty collections, or copying a body template and removing the ids array.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/40ebcf6b667a7a76. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskCollectionResource.java:418

        
        taskService.saveTask(task);

        return restResponseFactory.createTaskResponse(task);
    }

    @ApiOperation(value = "Update Tasks", tags = { "Tasks" })
    @ApiResponses(value = {
            @ApiResponse(code = 201, message = "Indicates request was successful and the tasks are returned"),
            @ApiResponse(code = 400, message = "Indicates a parameter was passed in the wrong format or that delegationState has an invalid value (other than pending and resolved). The status-message contains additional information.")
    })
    @PutMapping(value = "/runtime/tasks", produces = "application/json")
    public DataResponse<TaskResponse> bulkUpdateTasks(@RequestBody BulkTasksRequest bulkTasksRequest) {

        if (bulkTasksRequest == null) {
            throw new FlowableException("A request body was expected when bulk updating tasks.");
        }
        if (bulkTasksRequest.getTaskIds() == null) {
            throw new FlowableIllegalArgumentException("taskIds can not be null for bulk update tasks requests");
        }

        Collection<Task> taskList = getTasksFromIdList(bulkTasksRequest.getTaskIds());

        if (taskList.size() != bulkTasksRequest.getTaskIds().size()) {
            taskList.stream().forEach(task -> bulkTasksRequest.getTaskIds().remove(task.getId()));
            throw new FlowableObjectNotFoundException(
                    "Could not find task instance with id:" + bulkTasksRequest.getTaskIds().stream().collect(Collectors.joining(",")));
        }

        // Populate the task properties based on the request
        populateTasksFromRequest(taskList, bulkTasksRequest);

        if (restApiInterceptor != null) {
            restApiInterceptor.bulkUpdateTasks(taskList, bulkTasksRequest);
        }

        // Save the task and fetch again, it's possible that an

View on GitHub (pinned to d6d39ce1c6)