pub enum Command {
RunActivity {
key: CorrelationKey,
activity_type: String,
input: Payload,
},
AwaitSignal {
key: CorrelationKey,
},
SendSignal {
key: CorrelationKey,
delivery: SignalDelivery,
},
StartTimer {
key: CorrelationKey,
fire_at: DateTime<Utc>,
},
SpawnChild {
key: CorrelationKey,
workflow_type: String,
input: Payload,
},
AwaitChild {
child_workflow_id: WorkflowId,
},
CompleteWorkflow {
result: Payload,
},
}Expand description
World-touching workflow intent presented to the durability resolver.
Variants§
RunActivity
Run an activity identified by a deterministic activity scheduling key.
Fields
key: CorrelationKeyCorrelation key that must match the recorded activity schedule.
AwaitSignal
Await the next matching signal delivery.
Fields
key: CorrelationKeyCorrelation key naming the signal and occurrence index to deliver.
SendSignal
Send a signal to another workflow.
Fields
key: CorrelationKeyCorrelation key naming the sent signal occurrence.
delivery: SignalDeliveryDelivery selected by workflow code.
StartTimer
Start or await a timer identified by a deterministic timer key.
Fields
key: CorrelationKeyCorrelation key that must match the recorded timer start.
SpawnChild
Spawn a child workflow identified by a deterministic child scheduling key.
Fields
key: CorrelationKeyCorrelation key that must match the recorded child-workflow start.
AwaitChild
Await a previously spawned child workflow’s terminal outcome.
Fields
child_workflow_id: WorkflowIdChild workflow identity returned by Command::SpawnChild.
CompleteWorkflow
Complete the current workflow with a terminal result payload.
Workflow completion is terminal intent rather than a cursor-matched replay family, so it has no correlation key in AD-004.
Implementations§
Source§impl Command
impl Command
Sourcepub const fn key(&self) -> Option<&CorrelationKey>
pub const fn key(&self) -> Option<&CorrelationKey>
Returns the correlation key for cursor-matched commands.
Command::AwaitChild returns None because its replay identity is the awaited child
workflow id, matched against recorded child terminal events rather than a positional key.
Command::CompleteWorkflow returns None because completion is terminal intent, not a
recorded event family consumed by crate::durability::HistoryCursor.