Skip to content

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.

dart
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.

  • dueAt is an informational deadline.
  • expiresAt is an optional hard boundary. Recovery records workExpired; workflow code can handle that durable outcome.

Response ​

The service API performs, in one path:

  1. scope and run-visibility authorization;
  2. audience eligibility;
  3. response enforcement through the registered work response schema;
  4. electronic-signature verification when required;
  5. atomic response, attribution, and replay.

See Also ​