Definitions, instances, steps, and work items
Four terms should remain distinct.Workflow definition
AHumanWorkflow is treated as immutable, serializable data. Construction and
coordinator binding detach it from mutable authoring objects. It contains steps,
metadata, derived-value declarations, and repeat-block declarations. It does not
contain a database connection, model client, active respondent, or Python
callback.
Workflow instance
Launching a definition creates one instance with a unique identifier, a saved copy of the definition, a participant roster, and an execution status.Step
AHumanStep describes one kind of task: its survey, assignee selector,
dependencies, enable condition, completion policy, visibility, and optional
shared-state operations.
Work item
A work item is the assignment of one step to one participant in one instance. If a step selects six experts, launch creates six work items. The step is the graph node in the definition; the work items are its respondent-specific realizations.Work-item lifecycle
The normal lifecycle is:blocked: The dependencies have not reached terminal states.
ready: Dependencies are terminal and the enable condition is true. A durable outbox
record exists for delivery.
in_progress: The survey was opened or an execution attempt acquired a lease.
committing: An immutable response and its effects have been accepted. Recovery finishes
those effects without asking the respondent or model for another answer.
completed: The accepted answer and all of its state effects have completed.
skipped: A dependency was skipped, a condition evaluated false, or a repeat terminated
before this iteration.
superseded: Quorum succeeded before this assignment accepted a response. This does not
propagate a branch skip to ordinary downstream dependencies.
failed: The configured retry budget was exhausted or an error was classified as
non-retryable.
A dependency is settled when all of its work items are completed, skipped,
or superseded. A failed item instead fails its workflow instance. Accepted committing responses finish their effects before a step settles.
Participant selection and fan-out
role(name) constructs an exact trait selector:
traits["role"] == "reviewer" receives an independent
work item. This is fan-out.
The underlying selector can match several traits:
Dependencies and fan-in
Pass a step handle throughafter:
after. Explicit
after declarations are still recommended when they explain the graph.