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

  1. Add "assignee":"<userId>" to the task action request body
  2. Verify the action verb: resolve/complete do not require assignee, delegate does
  3. 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

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


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)