flowable/flowable-engine · error · FlowableIllegalArgumentException
Illegal action: '" + request.getAction() + "'.
Error message
Illegal action: '" + request.getAction() + "'.
What it means
Bulk deletion of historic process instances accepts an action envelope; only the action string "delete" (BulkDeleteInstancesRestActionRequest.DELETE_ACTION) is valid. Any other action value causes FlowableIllegalArgumentException listing the received action.
Source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java:315
}
@ApiOperation(value = "Post action request to delete a bulk of historic process instances", tags = {
"Manage History Process Instances" }, nickname = "bulkDeleteHistoricProcessInstances", code = 204)
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Indicates the bulk of historic process instances was found and deleted. Response body is left empty intentionally."),
@ApiResponse(code = 404, message = "Indicates at least one requested process instance was not found.")
})
@PostMapping(value = "/history/historic-process-instances/delete")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void bulkDeleteHistoricProcessInstances(@ApiParam(name = "bulkDeleteRestActionRequest")
@RequestBody BulkDeleteInstancesRestActionRequest request) {
if (BulkDeleteInstancesRestActionRequest.DELETE_ACTION.equals(request.getAction())) {
if (restApiInterceptor != null) {
restApiInterceptor.bulkDeleteHistoricProcessInstances(request.getInstanceIds());
}
historyService.bulkDeleteHistoricProcessInstances(request.getInstanceIds());
} else {
throw new FlowableIllegalArgumentException("Illegal action: '" + request.getAction() + "'.");
}
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Set the request body action to "delete" exactly
- Ensure the action field is present and non-null in the JSON payload
- Confirm instanceIds are also provided since the interceptor and historyService require them
Example fix
// before
{"action":"remove","instanceIds":["p1","p2"]}
// after
{"action":"delete","instanceIds":["p1","p2"]} Defensive patterns
Strategy: validation
Validate before calling
if (req.action !== 'delete') throw new Error('bulk action must be "delete"'); Type guard
const isDeleteAction = (a) => a === 'delete';
Try / catch
catch (e) { if (e.response && e.response.status === 400 && /Illegal action/.test(e.response.data.message)) { /* correct action field and retry */ } throw e; } Prevention
- Use the generated request model (BulkDeleteInstancesRestActionRequest) instead of hand-built JSON
- Assert action === 'delete' before sending
- Keep instanceIds non-empty alongside the action
When it happens
Trigger: POST to the historic process instance bulk-delete collection endpoint with a body whose action field is not exactly "delete" (null, typo, different verb).
Common situations: Generic delete UIs sending action names like "remove" or "purge"; null action omitted from the JSON body; API drift after upgrading Flowable REST versions.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Illegal action: '${request.getAction()}'.
- Unsupported variable query operation: " + variable.getVariab
- Illegal action: '${action}'.
- Variable operation is missing for variable: ${variable.getNa
- Variable value is missing for variable: ${variable.getName()
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/fcfcfa2ed80d3497.
Report an issue: GitHub.