Work
Work<I, R> describes assigned work requested from an actor. A request waits in storage as a WorkItem; responding records a typed result and drives replay. Actors include people, users, groups, roles, agents, bots, and services.
final decision = await flow.request(
approve,
reservation,
id: 'approve',
title: 'Approve order',
audience: Audience(roleIds: ['order-approver']),
priority: WorkPriority.high,
);Audience and Inbox
The audience is persisted with the command and projected to a WorkItem. Product inboxes render the response actions supplied by the server. They do not infer approval semantics from schema strings.
Claiming work never leases the workflow command to an operation worker. Claim state belongs to the work item; Audience remains the eligibility rule and assignee records the actor that claimed this instance.
Time
Work has no timeout by default. It can remain pending for years using only database state.
dueAtis an informational deadline.expiresAtis an optional hard boundary. Recovery recordsworkExpired; workflow code can handle that durable outcome.
Response
The service API performs, in one path:
- scope and run-visibility authorization;
- audience eligibility;
- response enforcement through the registered work response schema;
- electronic-signature verification when required;
- atomic response, attribution, and replay.