Skip to main content

User Tasks

User tasks are the human-handled work items in a process. The engine tracks the task's lifecycle, holds the variables it was created with, and waits for an external signal that the human has finished - typically delivered by a custom inbox UI or a workflow tool that calls the API.

This page is the integration guide for that external system. For modeling user tasks (assignment fields, forms, I/O mappings) see Tasks. The tutorial on External Workers builds a review inbox for a user task in Spring Boot.

Lifecycle​

A user task moves through one of four terminal states from CREATED:

StatusReached when
CREATEDThe activity entered the user-task node and the task was registered. The instance pauses until something terminates it
COMPLETEDAn external system calls Complete with the result variables
FAILEDAn external system calls ThrowError with a BPMN error code
CANCELEDThe instance was cancelled, an interrupting boundary fired on the task, the parent scope was modified, or the process terminated before the task finished

COMPLETED and FAILED carry the variables that were submitted alongside the call (completionVariables). CANCELED carries a best-effort cancelReason. FAILED carries the errorCode that was thrown.

Assignment model​

A user task can be addressed three ways at the same time:

FieldNotes
assigneeA single user the task is assigned to. Empty when only candidates are set
candidateUsersUsers who may complete the task, with or without an assignee
candidateGroupsIdentity-provider groups whose members may complete the task. A caller's groups are the entries of the token's roles claim, see Authentication

There is no claim step. A candidate completes the task directly, and an operator changes the assignee with the reassign endpoint below.

These fields come from <quantum:assignmentDefinition> in the model. They can be FEEL expressions evaluated at task entry, so the assignment can depend on the instance's variables.

Reassigning a CREATED task​

Operators can change assignment after the task has been registered:

PATCH /projects/{projectID}/bpmn/user-tasks/{executionKey}
FieldNotes
assigneeNew assignee. Pass "" to clear it and leave only the candidate pool
candidateUsersReplacement list of candidate users. [] clears it
candidateGroupsReplacement list of candidate groups. [] clears it

Only the fields you send change, the others keep their value. A body with none of them returns 400. The endpoint requires the Executor role on the project and only works on tasks still in CREATED. Tasks that have already terminated return 404.

Due date and priority​

FieldNotes
dueDateWhen the task is due. Absent when the model sets none
priorityAn integer from 0 to 100, higher is more urgent. 50 when the model sets none

These fields come from <quantum:taskSchedule> and <quantum:priorityDefinition> in the model, as a literal or a FEEL expression evaluated at task entry. The engine stores them and nothing else: a task past its due date stays CREATED until someone acts on it. Model an escalation or a reminder with a timer boundary event on the task. The list endpoints below filter by due date and sort by due date or priority, which is enough for an overdue view or a priority queue.

Who completed a task​

A user task's output mappings read the user who completed it as quantum.completedBy, the same value as the task's completedBy field. Map it into a variable to keep it:

<bpmn:userTask id="review" name="Review claim">
<bpmn:extensionElements>
<quantum:ioMapping>
<quantum:output source="=decision" target="decision" />
<quantum:output source="=quantum.completedBy" target="reviewer" />
</quantum:ioMapping>
</bpmn:extensionElements>
</bpmn:userTask>

The completion variables cannot set it, so a client cannot claim another user. The engine does not stop one user from completing two tasks of the same instance. A four-eyes rule belongs in your tasklist: pass reviewer into the approval task as an input, and refuse the approval when the caller is that user.

Access control​

The user-task endpoints have a dual-role model:

CallerCan list & act on
Has Executor (or higher) on the projectAny user task
Is the task's assigneeThis task
Is in candidateUsersThis task
Has any identity-provider group that overlaps candidateGroupsThis task

So the same Complete and ThrowError endpoints serve both an admin/integration use case (Executor service account) and an end-user use case (the human assignee).

The HTTP API​

All endpoints live under the project: /projects/{projectID}/bpmn/user-tasks. Same bearer-token auth as the rest of the API - see Authentication.

List all user tasks (admin)​

GET /projects/{projectID}/bpmn/user-tasks

Paginated. Optional query filters:

ParamNotes
instanceIDRestrict to one process instance. A test run's tasks are listed only this way
statusCREATED, COMPLETED, FAILED, or CANCELED
assigneeTasks currently assigned to this user
candidateUserTasks listing this user as a candidate
candidateGroupTasks listing this group
businessIdTasks whose instance carries exactly this business ID
dueAfter, dueBeforeTasks due in this range, dueAfter included and dueBefore excluded. Tasks without a due date never match. dueBefore set to now lists the overdue tasks
sortcreated lists the newest first, the default. dueDate lists the soonest due first, tasks without a due date last. priority lists the highest priority first. Both list the oldest first among equals
cursor, limitPagination. Pass the previous page's pagination.nextCursor as cursor, it is absent on the last page. A cursor continues only a list with the same sort, otherwise the call returns 400. limit is 20 by default and 100 at most

Requires Executor on the project. Useful for building an admin queue view.

List the caller's tasks​

GET /projects/{projectID}/bpmn/user-tasks/me

Returns CREATED tasks the caller can act on - directly assigned, listed in candidateUsers, or whose candidateGroups overlap any of the caller's identity-provider groups. It takes the same dueAfter, dueBefore, sort, cursor and limit as the admin list. Requires Viewer on the project.

This is the right endpoint for an end-user "my inbox" UI. The platform doesn't ship one out of the box, the endpoint exists so you can build one.

Get a single user task​

GET /projects/{projectID}/bpmn/user-tasks/{executionKey}

Fetches one task by execution key. Returns 403 if the caller is neither Executor nor on the task's assignment fields, 404 if the task doesn't exist.

A task object looks like this:

{
"executionKey": "002a-…",
"instanceID": "bpmn-002a-approval-…",
"nodeID": "approve-request",
"assignee": "manager",
"candidateGroups": ["approvers", "leads"],
"dueDate": "2026-05-04T12:34:56Z",
"priority": 80,
"formKey": "approve-form",
"variables": { "request_id": "REQ-123", "amount": 500 },
"headers": { "region": "emea" },
"status": "CREATED",
"createdAt": "2026-05-02T12:34:56Z"
}

Complete a task​

POST /projects/{projectID}/bpmn/user-tasks/{executionKey}/complete

Finalises the task successfully. The variables are merged into the originating instance's scope (after any output mappings declared on the user task) and the process advances.

FieldRequiredNotes
variablesnoOutput variables from the form / handler
curl -X POST "$API/projects/$PROJECT/bpmn/user-tasks/$KEY/complete" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"variables": { "approved": true, "comment": "looks good" }
}'

Only one report reaches a task. Completing or failing a task that is no longer open returns 409 with code CONFLICT and nothing is applied: it was already completed or failed, perhaps by another user of the same candidate pool a moment earlier, or it was cancelled, for example by an interrupting boundary event. Refresh the task list and move on.

Fail a task with a BPMN error​

POST /projects/{projectID}/bpmn/user-tasks/{executionKey}/error

Reports that the task can't be completed. The errorCode is raised as a BPMN error from the user-task node - any matching error boundary event on the task takes the failure path, otherwise the instance gets an incident.

FieldRequiredNotes
errorCodeyesMatched against errorRef on attached error boundary events
variablesnoVariables submitted alongside the error. Available to error-boundary handlers
curl -X POST "$API/projects/$PROJECT/bpmn/user-tasks/$KEY/error" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"errorCode": "REJECTED",
"variables": { "reason": "missing supporting documents" }
}'

This is what makes error boundary events on user tasks useful - model the failure path in BPMN, route the rejection through it from your form's "reject" button.

Forms​

User tasks carry two form references for your UI to resolve:

FieldSourceUse
formKey<quantum:formDefinition formKey="..."> in the modelStable string your UI maps to a rendering. Often the simplest pattern: the form key matches a known component or template name
formID<quantum:formDefinition formId="..."> in the modelResolved internal identifier when formKey corresponds to a stored form definition

Use whichever fits your stack. The engine doesn't render forms - it just hands the keys to your UI alongside the input variables and headers.

Error handling​

The flow when a user task fails:

  1. The caller invokes ThrowError with an errorCode and optional variables.
  2. The engine raises a BPMN error from the user-task node carrying that code.
  3. If a matching error boundary event is attached to the task, the token routes through the boundary. The boundary handler's scope receives the variables submitted with the error.
  4. If there's no matching boundary, the error propagates up the scope chain to the nearest matching listener - an error boundary on a parent sub-process, or an error event sub-process.
  5. If nothing catches it, the instance gets an incident and pauses.

Treat ThrowError as the user-task analogue of a worker reporting a job failure - the BPMN error code is how the model expresses what went wrong.

In the UI​

Each instance's detail page lists its user tasks under a dedicated accordion section. See Operating live instances → User tasks for the columns shown.

The diagram view of a running instance highlights any active user-task nodes alongside other active elements. There's no first-party inbox UI - the /me endpoint is there for you to build one.