{"record":{"id":"24d84b727806d564","repo":"flowable/flowable-engine","slug":"illegal-action-action-24d84b","errorCode":null,"errorMessage":"Illegal action: '${action}'.","messagePattern":"Illegal action: '(.+?)'\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java","lineNumber":469,"sourceCode":"        }\n    }\n\n    @ApiOperation(value = \"Bulk delete process instances\", tags = { \"Process Instances\" }, nickname = \"deleteProcessInstances\", code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the bulk of process instances was found and deleted. Response body is left empty intentionally.\"),\n            @ApiResponse(code = 404, message = \"Indicates at least one requested process instance was not found.\")\n    })\n    @PostMapping(value = \"/runtime/process-instances/delete\")\n    @ResponseStatus(value = HttpStatus.NO_CONTENT)\n    public void bulkDeleteProcessInstances(@RequestBody BulkDeleteInstancesRestActionRequest request) {\n        if (BulkDeleteInstancesRestActionRequest.DELETE_ACTION.equals(request.getAction())) {\n\n            if (restApiInterceptor != null) {\n                restApiInterceptor.bulkDeleteProcessInstances(request.getInstanceIds());\n            }\n            runtimeService.bulkDeleteProcessInstances(request.getInstanceIds(), request.getDeleteReason());\n        } else {\n            throw new FlowableIllegalArgumentException(\"Illegal action: '\" + request.getAction() + \"'.\");\n        }\n    }\n}\n","sourceCodeStart":451,"sourceCodeEnd":473,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java#L451-L473","documentation":"The bulk-delete endpoint accepts a request with an 'action' field, and only a specific delete action is legal. If the action string is anything else, bulkDeleteProcessInstances throws FlowableIllegalArgumentException listing the offending action value. This guards against unsupported bulk operations being silently ignored.","triggerScenarios":"POST /runtime/process-instances/delete (or the bulk-delete sub-resource) with a body whose \"action\" is not the supported delete value, e.g. {\"action\":\"suspend\",\"instanceIds\":[\"...\"]}. Thrown at ProcessInstanceCollectionResource.java:469.","commonSituations":"Copying a request body from a different endpoint (e.g. job or task actions); misspelling the action enum; client library versions where the action constant changed between Flowable releases.","solutions":["Set \"action\" to the supported value used by this endpoint's delete request (match the constant in the Flowable REST model/DTO).","Check your client DTO's action field against the Flowable version you run; enum values differ across releases.","If you meant a different operation (suspend/activate), call the corresponding dedicated endpoint instead of the bulk-delete one."],"exampleFix":"// before\nPOST /runtime/process-instances/delete {\"action\":\"remove\",\"instanceIds\":[\"pi-1\"]}\n// after\nPOST /runtime/process-instances/delete {\"action\":\"delete\",\"instanceIds\":[\"pi-1\"],\"deleteReason\":\"cleanup\"}","handlingStrategy":"validation","validationCode":"if (!\"delete\".equals(bulkRequest.getAction())) {\n    throw new IllegalArgumentException(\"bulk delete only supports action=delete, got: \" + bulkRequest.getAction());\n}","typeGuard":null,"tryCatchPattern":"try {\n    restClient.bulkDeleteProcessInstances(req);\n} catch (HttpClientErrorException.BadRequest e) {\n    if (e.getResponseBodyAsString().startsWith(\"Illegal action:\")) {\n        // fix action enum value\n    }\n}","preventionTips":["Use the Flowable REST model constant for the action instead of string literals.","Check the action enum against your Flowable version when upgrading.","Route suspend/activate operations to their dedicated endpoints."],"tags":["rest-api","bulk-delete","invalid-enum-value","java"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}