{"record":{"id":"40ebcf6b667a7a76","repo":"flowable/flowable-engine","slug":"taskids-can-not-be-null-for-bulk-update-tasks-requ-40ebcf","errorCode":null,"errorMessage":"taskIds can not be null for bulk update tasks requests","messagePattern":"taskIds can not be null for bulk update tasks requests","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskCollectionResource.java","lineNumber":418,"sourceCode":"        \n        taskService.saveTask(task);\n\n        return restResponseFactory.createTaskResponse(task);\n    }\n\n    @ApiOperation(value = \"Update Tasks\", tags = { \"Tasks\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 201, message = \"Indicates request was successful and the tasks are returned\"),\n            @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.\")\n    })\n    @PutMapping(value = \"/runtime/tasks\", produces = \"application/json\")\n    public DataResponse<TaskResponse> bulkUpdateTasks(@RequestBody BulkTasksRequest bulkTasksRequest) {\n\n        if (bulkTasksRequest == null) {\n            throw new FlowableException(\"A request body was expected when bulk updating tasks.\");\n        }\n        if (bulkTasksRequest.getTaskIds() == null) {\n            throw new FlowableIllegalArgumentException(\"taskIds can not be null for bulk update tasks requests\");\n        }\n\n        Collection<Task> taskList = getTasksFromIdList(bulkTasksRequest.getTaskIds());\n\n        if (taskList.size() != bulkTasksRequest.getTaskIds().size()) {\n            taskList.stream().forEach(task -> bulkTasksRequest.getTaskIds().remove(task.getId()));\n            throw new FlowableObjectNotFoundException(\n                    \"Could not find task instance with id:\" + bulkTasksRequest.getTaskIds().stream().collect(Collectors.joining(\",\")));\n        }\n\n        // Populate the task properties based on the request\n        populateTasksFromRequest(taskList, bulkTasksRequest);\n\n        if (restApiInterceptor != null) {\n            restApiInterceptor.bulkUpdateTasks(taskList, bulkTasksRequest);\n        }\n\n        // Save the task and fetch again, it's possible that an","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskCollectionResource.java#L400-L436","documentation":"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.","triggerScenarios":"PUT /runtime/tasks with a JSON body that omits the taskIds field or explicitly sets it to null.","commonSituations":"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.","solutions":["Include a non-null taskIds array in the request body, e.g. {\"taskIds\":[\"id1\",\"id2\"], ...}.","Fix field-name typos so it matches taskIds exactly.","Ensure the client serializer emits empty arrays rather than omitting/nulling the field.","Validate the body client-side before sending (taskIds != null && taskIds.size() > 0)."],"exampleFix":"// before\n{\"action\": \"complete\"}\n// after\n{\"action\": \"complete\", \"taskIds\": [\"1001\", \"1002\"]}","handlingStrategy":"validation","validationCode":"if (body.taskIds == null || !Array.isArray(body.taskIds)) {\n    throw new Error('taskIds must be a non-null array');\n}","typeGuard":"function hasTaskIds(b) { return Array.isArray(b && b.taskIds); }","tryCatchPattern":"try {\n    // PUT /runtime/tasks\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().includes('taskIds can not be null')) {\n        // populate taskIds and retry\n    } else throw e;\n}","preventionTips":["Match the field name taskIds exactly","Ensure serializers emit empty arrays rather than null/omitted fields","Validate bulk request DTOs before sending"],"tags":["rest-api","flowable","validation","request-body"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}