flowable/flowable-engine · error · FlowableIllegalArgumentException

Illegal action: '${request.getAction()}'.

Error message

Illegal action: '${request.getAction()}'.

What it means

FlowableIllegalArgumentException from the bulk delete historic case instances endpoint: the request body's action field is not the expected 'delete' value. The endpoint only supports the DELETE_ACTION constant.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceCollectionResource.java:336

    @ApiOperation(value = "Post action request to delete a bulk of historic case instances", tags = {
            "Manage History Case Instances" }, nickname = "bulkDeleteHistoricCaseInstances",
            code = 204)
    @ApiResponses(value = {
            @ApiResponse(code = 204, message = "Indicates the bulk of historic case instances was found and deleted. Response body is left empty intentionally."),
            @ApiResponse(code = 404, message = "Indicates at least one requested case instance was not found.")
    })
    @PostMapping(value = "/cmmn-history/historic-case-instances/delete")
    @ResponseStatus(value = HttpStatus.NO_CONTENT)
    public void bulkDeleteHistoricCaseInstances(@ApiParam(name = "bulkDeleteRestActionRequest")
    @RequestBody BulkDeleteInstancesRestActionRequest request) {
        if (BulkDeleteInstancesRestActionRequest.DELETE_ACTION.equals(request.getAction())) {
            if (restApiInterceptor != null) {
                restApiInterceptor.bulkDeleteHistoricCases(request.getInstanceIds());
            }
            historyService.bulkDeleteHistoricCaseInstances(request.getInstanceIds());
        } else {
            throw new FlowableIllegalArgumentException("Illegal action: '" + request.getAction() + "'.");
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Set action exactly to "delete" in the request body
  2. Ensure instanceIds is also present and non-empty
  3. Check the REST API docs for the exact endpoint contract
  4. Compare constant BulkDeleteInstancesRestActionRequest.DELETE_ACTION in your Flowable version

Example fix

// before
{"action":"remove","instanceIds":["a","b"]}
// after
{"action":"delete","instanceIds":["a","b"]}
Defensive patterns

Strategy: validation

Validate before calling

if (!"delete".equals(request.action)) throw new IllegalArgumentException("action must be 'delete'");

Type guard

boolean isBulkDeleteAction(String action) { return "delete".equals(action); }

Try / catch

try { ... } catch (FlowableIllegalArgumentException e) {
  return badRequest("Unsupported bulk action: " + e.getMessage());
}

Prevention

When it happens

Trigger: POST to .../historic-case-instances/bulk-delete (or equivalent) with {"action":"remove",...} or a missing/misspelled action instead of {"action":"delete","instanceIds":[...]}.

Common situations: Client code invents its own action verb; version drift where another bulk endpoint uses a different action string; JSON casing issues ("Delete" vs "delete").

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


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