pub enum Event {
Show 28 variants
WorkflowStarted {
envelope: EventEnvelope,
workflow_type: String,
input: Payload,
run_id: RunId,
parent_run_id: Option<RunId>,
package_version: PackageVersion,
},
WorkflowCompleted {
envelope: EventEnvelope,
result: Payload,
},
WorkflowFailed {
envelope: EventEnvelope,
error: WorkflowError,
},
WorkflowCancelled {
envelope: EventEnvelope,
reason: String,
},
WorkflowTimedOut {
envelope: EventEnvelope,
timeout: String,
},
WorkflowContinuedAsNew {
envelope: EventEnvelope,
input: Payload,
workflow_type: Option<String>,
parent_run_id: RunId,
},
SearchAttributesUpdated {
envelope: EventEnvelope,
workflow_id: WorkflowId,
attributes: HashMap<String, SearchAttributeValue>,
},
ActivityScheduled {
envelope: EventEnvelope,
activity_id: ActivityId,
activity_type: String,
input: Payload,
},
ActivityStarted {
envelope: EventEnvelope,
activity_id: ActivityId,
},
ActivityCompleted {
envelope: EventEnvelope,
activity_id: ActivityId,
result: Payload,
},
ActivityFailed {
envelope: EventEnvelope,
activity_id: ActivityId,
error: ActivityError,
attempt: u32,
},
ActivityCancelled {
envelope: EventEnvelope,
activity_id: ActivityId,
},
TimerStarted {
envelope: EventEnvelope,
timer_id: TimerId,
fire_at: DateTime<Utc>,
},
TimerFired {
envelope: EventEnvelope,
timer_id: TimerId,
},
TimerCancelled {
envelope: EventEnvelope,
timer_id: TimerId,
},
WithTimeoutCompleted {
envelope: EventEnvelope,
timer_id: TimerId,
outcome: WithTimeoutOutcome,
result: Option<Payload>,
},
SignalReceived {
envelope: EventEnvelope,
name: String,
payload: Payload,
},
SignalSent {
envelope: EventEnvelope,
target_workflow_id: WorkflowId,
name: String,
payload: Payload,
},
ChildWorkflowStarted {
envelope: EventEnvelope,
child_workflow_id: WorkflowId,
workflow_type: String,
input: Payload,
package_version: PackageVersion,
},
ChildWorkflowCompleted {
envelope: EventEnvelope,
child_workflow_id: WorkflowId,
result: Payload,
},
ChildWorkflowFailed {
envelope: EventEnvelope,
child_workflow_id: WorkflowId,
error: WorkflowError,
},
ChildWorkflowCancelled {
envelope: EventEnvelope,
child_workflow_id: WorkflowId,
},
ScheduleCreated {
envelope: EventEnvelope,
schedule_id: ScheduleId,
config: ScheduleConfig,
},
ScheduleUpdated {
envelope: EventEnvelope,
schedule_id: ScheduleId,
config: ScheduleConfig,
},
SchedulePaused {
envelope: EventEnvelope,
schedule_id: ScheduleId,
},
ScheduleResumed {
envelope: EventEnvelope,
schedule_id: ScheduleId,
},
ScheduleDeleted {
envelope: EventEnvelope,
schedule_id: ScheduleId,
},
ScheduleTriggered {
envelope: EventEnvelope,
schedule_id: ScheduleId,
workflow_id: WorkflowId,
run_id: RunId,
},
}Expand description
A recorded workflow history event.
User data is carried as opaque Payload values, while failures use the closed workflow and
activity error types from this crate.
Variants§
WorkflowStarted
A workflow execution started with a type name and input payload.
Fields
envelope: EventEnvelopeRecording metadata for this event.
parent_run_id: Option<RunId>Parent run that continued as this run, when this start is part of a continue-as-new chain.
package_version: PackageVersionPackage version this run was resolved against at record time.
Recovery and replay resolve workflow code from this recorded version; they never re-resolve a “latest” version.
WorkflowCompleted
A workflow execution completed successfully; this terminal event projects to Completed.
Fields
envelope: EventEnvelopeRecording metadata for this event.
WorkflowFailed
A workflow execution failed terminally; this terminal event projects to Failed.
Fields
envelope: EventEnvelopeRecording metadata for this event.
error: WorkflowErrorTerminal workflow failure.
WorkflowCancelled
A workflow execution was cancelled; this terminal event projects to Cancelled.
Fields
envelope: EventEnvelopeRecording metadata for this event.
WorkflowTimedOut
A workflow execution timed out; this terminal event projects to TimedOut.
Fields
envelope: EventEnvelopeRecording metadata for this event.
WorkflowContinuedAsNew
A workflow execution continued as a new run; this terminal event projects to
ContinuedAsNew.
Fields
envelope: EventEnvelopeRecording metadata for this event.
SearchAttributesUpdated
Workflow search attributes were updated for visibility and query projection.
Fields
envelope: EventEnvelopeRecording metadata for this event.
workflow_id: WorkflowIdWorkflow whose search attributes changed.
attributes: HashMap<String, SearchAttributeValue>Updated search attributes keyed by attribute name.
ActivityScheduled
An activity was scheduled by workflow code.
Fields
envelope: EventEnvelopeRecording metadata for this event.
activity_id: ActivityIdDeterministic activity identifier derived from the scheduling sequence position.
ActivityStarted
An activity worker started executing an activity attempt.
Fields
envelope: EventEnvelopeRecording metadata for this event.
activity_id: ActivityIdActivity being executed.
ActivityCompleted
An activity completed successfully.
Fields
envelope: EventEnvelopeRecording metadata for this event.
activity_id: ActivityIdActivity that produced the result.
ActivityFailed
An activity attempt failed.
The attempt field together with ActivityError’s retryable or terminal classification
lets replay distinguish a retryable interim failure from a terminal one for the same
ActivityId.
Fields
envelope: EventEnvelopeRecording metadata for this event.
activity_id: ActivityIdActivity whose attempt failed.
error: ActivityErrorClassified activity failure.
ActivityCancelled
An activity was cancelled as an explicit cancellation outcome.
Fields
envelope: EventEnvelopeRecording metadata for this event.
activity_id: ActivityIdActivity that was cancelled.
TimerStarted
A timer was scheduled to fire at a deterministic timestamp.
Fields
envelope: EventEnvelopeRecording metadata for this event.
TimerFired
A timer fired.
Fields
envelope: EventEnvelopeRecording metadata for this event.
TimerCancelled
A timer was cancelled as an explicit cancellation outcome.
Fields
envelope: EventEnvelopeRecording metadata for this event.
WithTimeoutCompleted
A with_timeout operation reached a durable terminal outcome.
Fields
envelope: EventEnvelopeRecording metadata for this event.
outcome: WithTimeoutOutcomeRecorded timeout outcome.
SignalReceived
A signal was delivered to the workflow.
Fields
envelope: EventEnvelopeRecording metadata for this event.
SignalSent
A signal was sent by this workflow to another workflow.
Fields
envelope: EventEnvelopeRecording metadata for this event.
target_workflow_id: WorkflowIdTarget workflow identifier selected by workflow code.
ChildWorkflowStarted
A child workflow was started.
Fields
envelope: EventEnvelopeRecording metadata for this event.
child_workflow_id: WorkflowIdChild workflow identifier.
package_version: PackageVersionPackage version resolved for the child at record time.
The crash-repair sweep and the child’s own start use exactly this recorded version, so the crash path resolves identically to the crash-free path.
ChildWorkflowCompleted
A child workflow completed successfully.
Fields
envelope: EventEnvelopeRecording metadata for this event.
child_workflow_id: WorkflowIdChild workflow that produced the result.
ChildWorkflowFailed
A child workflow failed terminally.
Fields
envelope: EventEnvelopeRecording metadata for this event.
child_workflow_id: WorkflowIdChild workflow that failed.
error: WorkflowErrorTerminal child workflow failure.
ChildWorkflowCancelled
A child workflow was cancelled as an explicit cancellation outcome.
Fields
envelope: EventEnvelopeRecording metadata for this event.
child_workflow_id: WorkflowIdChild workflow that was cancelled.
ScheduleCreated
A schedule resource was created.
Fields
envelope: EventEnvelopeRecording metadata for this event.
schedule_id: ScheduleIdSchedule resource that was created.
config: ScheduleConfigPersisted schedule configuration.
ScheduleUpdated
A schedule resource was updated.
Fields
envelope: EventEnvelopeRecording metadata for this event.
schedule_id: ScheduleIdSchedule resource that was updated.
config: ScheduleConfigUpdated schedule configuration.
SchedulePaused
A schedule resource was paused.
Fields
envelope: EventEnvelopeRecording metadata for this event.
schedule_id: ScheduleIdSchedule resource that was paused.
ScheduleResumed
A paused schedule resource was resumed.
Fields
envelope: EventEnvelopeRecording metadata for this event.
schedule_id: ScheduleIdSchedule resource that was resumed.
ScheduleDeleted
A schedule resource was deleted.
Fields
envelope: EventEnvelopeRecording metadata for this event.
schedule_id: ScheduleIdSchedule resource that was deleted.
ScheduleTriggered
A schedule tick started a workflow execution.
Fields
envelope: EventEnvelopeRecording metadata for this event.
schedule_id: ScheduleIdSchedule resource that fired.
workflow_id: WorkflowIdWorkflow execution started by the schedule tick.
Implementations§
Source§impl Event
impl Event
Sourcepub const fn envelope(&self) -> &EventEnvelope
pub const fn envelope(&self) -> &EventEnvelope
Returns the envelope recorded with this event.
Sourcepub const fn recorded_at(&self) -> &DateTime<Utc>
pub const fn recorded_at(&self) -> &DateTime<Utc>
Returns the deterministic recorded timestamp for this event.
Sourcepub const fn workflow_id(&self) -> &WorkflowId
pub const fn workflow_id(&self) -> &WorkflowId
Returns the workflow history that owns this event.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Event
Source§impl TS for Event
impl TS for Event
Source§type WithoutGenerics = Event
type WithoutGenerics = Event
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = Event
type OptionInnerType = Event
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more