flowable/flowable-engine · error · FlowableIllegalArgumentException
An assignee is required when delegating a task.
Error message
An assignee is required when delegating a task.
What it means
FlowableIllegalArgumentException thrown by TaskResource.delegateTask when action=delegate is requested without an assignee. Delegation in Flowable requires a target user to delegate to; the engine API delegateTask(taskId, userId) cannot be invoked with null.
Solutions
- Add "assignee":"<userId>" to the task action request body
- Verify the action verb: resolve/complete do not require assignee, delegate does
- Guard client-side: only send action=delegate after the assignee value is confirmed non-null
Example fix
// before
{"action":"delegate"}
// after
{"action":"delegate","assignee":"kermit"} Defensive patterns
Strategy: validation
Validate before calling
if (action.equals("delegate") && (assignee == null || assignee.isEmpty())) throw new IllegalArgumentException("assignee required for delegate"); Try / catch
try { delegate(taskId, assignee) } catch (FlowableIllegalArgumentException e) { promptUserForAssignee(); } Prevention
- Require assignee in any UI/workflow step that selects the delegate action
- Model each action's required fields in your client DTO validation
- Remember: claim and resolve differ from delegate in required fields
When it happens
Trigger: POST /runtime/tasks/{taskId}/action with {"action":"delegate"} and no assignee field (or assignee: null) in the body.
Common situations: Copy-pasting a claim/complete request and changing only the action field; forgetting that delegate, unlike claim/complete, mandates an assignee.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- A group or a user is required to create an identity link.
- A request body was expected when executing the form submit.
- An assignee is required when delegating a task.
- Attachment name is required.
- Can only unacquire BPMN or CMMN external job. Job with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/58d4c2d7b04f9503.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskResource.java:246
}
}
}
taskCompletionBuilder
.taskId(task.getId())
.formDefinitionId(actionRequest.getFormDefinitionId())
.outcome(actionRequest.getOutcome())
.complete();
}
protected void resolveTask(Task task, TaskActionRequest actionRequest) {
taskService.resolveTask(task.getId());
}
protected void delegateTask(Task task, TaskActionRequest actionRequest) {
if (actionRequest.getAssignee() == null) {
throw new FlowableIllegalArgumentException("An assignee is required when delegating a task.");
}
taskService.delegateTask(task.getId(), actionRequest.getAssignee());
}
protected void claimTask(Task task, TaskActionRequest actionRequest) {
// In case the task is already claimed, a
// FlowableTaskAlreadyClaimedException is thrown and converted to
// a CONFLICT response by the ExceptionHandlerAdvice
taskService.claim(task.getId(), actionRequest.getAssignee());
}
protected void unclaimTask(Task task) {
taskService.unclaim(task.getId());
}
}
View on GitHub (pinned to d6d39ce1c6)