flowable/flowable-engine · error · FlowableIllegalArgumentException
Illegal value for delegationState
Error message
Illegal value for delegationState: ${delegationState} What it means
TaskBaseResource.getDelegationState converts a query parameter string into the DelegationState enum, accepting only the lowercase names 'resolved' and 'pending'. Any other value cannot be mapped, so FlowableIllegalArgumentException is thrown with the offending value.
Solutions
- Send delegationState=pending or delegationState=resolved (lowercase).
- Omit the parameter entirely when you do not want to filter on delegation state.
- Whitelist/normalize the value in the client before building the query.
- Catch the 400 response and correct the parameter.
Example fix
// before GET /runtime/tasks?delegationState=PENDING // after GET /runtime/tasks?delegationState=pending
Defensive patterns
Strategy: validation
Validate before calling
if (delegationState != null && !['pending','resolved'].includes(delegationState)) throw new Error('delegationState must be pending or resolved'); Type guard
const isDelegationState = (s) => s === 'pending' || s === 'resolved';
Try / catch
try { await queryTasks({delegationState}); } catch (e) { if (e.status === 400 && /delegationState/.test(e.message)) { delete params.delegationState; } else { throw e; } } Prevention
- Send lowercase enum names
- Only include the parameter when filtering is intended
- Map UI enum values through a lowercase normalization step
When it happens
Trigger: Task query REST call with delegationState=<value> where value is not 'pending' or 'resolved' (e.g. 'PENDING' uppercase, 'delegated', an empty string, or 'involved').
Common situations: Passing the raw enum name in uppercase; UI dropdowns listing states not valid for task queries; copied values from process-instance APIs that support extra states.
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
- Only 'binary' and 'serializable' are supported as variable…
- Only 'binary' and 'serializable' are supported as variable…
- Only one of 'orderAscendingColumn' or…
- Only one of 'timersOnly' or 'messagesOnly' can be provided.
- Only one of 'timersOnly' or 'messagesOnly' can be provided.
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8fda57d25ebc3a94.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java:82
@Autowired
protected CmmnTaskService taskService;
@Autowired
protected CmmnHistoryService historyService;
@Autowired(required=false)
protected CmmnRestApiInterceptor restApiInterceptor;
protected DelegationState getDelegationState(String delegationState) {
DelegationState state = null;
if (delegationState != null) {
if (DelegationState.RESOLVED.name().toLowerCase().equals(delegationState)) {
return DelegationState.RESOLVED;
} else if (DelegationState.PENDING.name().toLowerCase().equals(delegationState)) {
return DelegationState.PENDING;
} else {
throw new FlowableIllegalArgumentException("Illegal value for delegationState: " + delegationState);
}
}
return state;
}
/**
* Populate the task based on the values that are present in the given {@link TaskRequest}.
*/
protected void populateTaskFromRequest(Task task, TaskRequest taskRequest) {
if (taskRequest.isNameSet()) {
task.setName(taskRequest.getName());
}
if (taskRequest.isAssigneeSet()) {
task.setAssignee(taskRequest.getAssignee());
}
if (taskRequest.isDescriptionSet()) {
task.setDescription(taskRequest.getDescription());
}View on GitHub (pinned to d6d39ce1c6)