Process Manager Pattern
For long-running workflows that span multiple events and time periods:
struct OrderFulfillmentProcess {
order_id: Uuid,
state: FulfillmentState,
started_at: DateTime<Utc>,
}
enum FulfillmentState {
WaitingForPayment,
WaitingForInventory,
WaitingForShipment,
Completed,
Failed(String),
}
The process manager listens to events, correlates them by order ID, and drives the workflow to completion. It's the orchestrator in a choreography-heavy system.
AWS Step Functions is a managed process manager.