User Tasks
A user task is assigned work that waits in storage. Completing it records a typed response and drives replay.
dart
final decision = await flow.userTask(
approve,
reservation,
id: 'approve',
title: 'Approve order',
assignment: Assignment(roleIds: ['order-approver']),
priority: UserTaskPriority.high,
);Assignment and Inbox
Assignment is persisted on the command and projected to workflow_user_tasks. The product inbox reads that projection. cdx_feature_workflows renders actions from the sealed UserTaskAction list supplied by the server. It does not infer approval semantics from schema strings.
Claiming a human task never leases the workflow command to a worker. Human claim state lives on the user-task row. Command fencing is for activity workers.
Time
User tasks have no timeout by default. They can remain pending for years using only database state.
dueAtis an informational deadline.expiresAtis an optional hard boundary. Recovery recordsuserTaskExpired; workflow code can catchUserTaskExpiredException.
Completion
The service API performs, in one path:
- scope and run-visibility authorization;
- assignment eligibility;
- response validation through the registered codec;
- electronic-signature verification when required;
- atomic completion, attribution, and replay.