pub struct Workflow<A: Address, K, Route: DeliveryRoute<Protocol: Protocol<Addr = A, Msg = WorkflowOutcome<K>>>> { /* private fields */ }Expand description
Deterministic dependency-ordered workflow coordinator.
Construction validates a finite acyclic graph. Start activates every
root in definition order. Completion activates a blocked step exactly once
when all of its prerequisites are complete. Unknown, blocked, duplicate,
and post-start terminal input is explicitly rejected without mutation.
Completion or failure input before Start is returned as a typed
WorkflowError::NotStarted because no result route has been established.
Failure and cancellation are terminal and prevent later activation. Initialization is
empty and the actor itself remains available to report terminal rejection.
Graph validation, one-run retention, activation ordering, and terminal
policy are Bombay choices. The actor model requires only that each event be
processed as one transition; participant execution and durable saga state
belong to the Driver/Mnesis boundaries. No transition panics.
Implementations§
Source§impl<A, K, Route> Workflow<A, K, Route>where
A: Address,
K: Clone + Eq,
Route: DeliveryRoute<Protocol: Protocol<Addr = A, Msg = WorkflowOutcome<K>>> + Clone,
impl<A, K, Route> Workflow<A, K, Route>where
A: Address,
K: Clone + Eq,
Route: DeliveryRoute<Protocol: Protocol<Addr = A, Msg = WorkflowOutcome<K>>> + Clone,
Sourcepub fn new(
definition: WorkflowDefinition<K>,
) -> Result<Self, WorkflowConfigError<K>>
pub fn new( definition: WorkflowDefinition<K>, ) -> Result<Self, WorkflowConfigError<K>>
Validate and retain one dependency graph.
§Errors
Returns a concrete WorkflowConfigError for empty, duplicate,
unknown, self-dependent, or cyclic definitions.
Sourcepub const fn definition(&self) -> &WorkflowDefinition<K>
pub const fn definition(&self) -> &WorkflowDefinition<K>
Borrow the validated definition.
Sourcepub const fn state(&self) -> &WorkflowState<K, Route>
pub const fn state(&self) -> &WorkflowState<K, Route>
Borrow the complete workflow phase.