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

Within bulkUpdateTasks, a non-null BulkTasksRequest must carry a taskIds collection. If getTaskIds() returns null, the request cannot identify any tasks and FlowableIllegalArgumentException is thrown.

Source

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

        
        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 = "/cmmn-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 = getTasksFromRequest(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)

Solutions

  1. Include a non-null taskIds array in the BulkTasksRequest body
  2. Check the JSON field name is exactly taskIds
  3. Validate the body client-side before issuing the PUT
  4. Handle 400 (FlowableIllegalArgumentException maps to bad request) by fixing the payload

Example fix

// before
{"assignee":"kermit"}
// after
{"taskIds":["t1","t2"],"assignee":"kermit"}
Defensive patterns

Strategy: validation

Validate before calling

if (!Array.isArray(body.taskIds) || body.taskIds.length === 0) throw new Error('taskIds is required for bulk update');

Type guard

const hasTaskIds = (b) => b != null && Array.isArray(b.taskIds) && b.taskIds.length > 0;

Try / catch

try { await bulkUpdate(body); } catch (e) { if (e.message.includes('taskIds can not be null')) { /* correct payload then retry */ } throw e; }

Prevention

When it happens

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

Common situations: Clients sending only the property-update fields and forgetting taskIds; JSON field name mismatch (taskId vs taskIds); null after partial deserialization.

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/ec53e3720b2b493b. Report an issue: GitHub.