Skip to main content

Event

Enum Event 

Source
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: EventEnvelope

Recording metadata for this event.

§workflow_type: String

Workflow type selected by the caller.

§input: Payload

Opaque workflow input payload.

§run_id: RunId

Concrete run identifier started by 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: PackageVersion

Package 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: EventEnvelope

Recording metadata for this event.

§result: Payload

Opaque workflow result payload.

§

WorkflowFailed

A workflow execution failed terminally; this terminal event projects to Failed.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§error: WorkflowError

Terminal workflow failure.

§

WorkflowCancelled

A workflow execution was cancelled; this terminal event projects to Cancelled.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§reason: String

Human-readable cancellation reason.

§

WorkflowTimedOut

A workflow execution timed out; this terminal event projects to TimedOut.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§timeout: String

Descriptor identifying the timeout that elapsed.

Intentionally stringly-typed: the closed set of timeout kinds is defined by cluster AT (timers and signals), not by the core event model.

§

WorkflowContinuedAsNew

A workflow execution continued as a new run; this terminal event projects to ContinuedAsNew.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§input: Payload

Opaque workflow input payload carried into the new run.

§workflow_type: Option<String>

Workflow type override for the new run, when migration changes the workflow type.

When absent, the new run uses the current workflow type.

§parent_run_id: RunId

Run identifier for the current run that is being continued.

§

SearchAttributesUpdated

Workflow search attributes were updated for visibility and query projection.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§workflow_id: WorkflowId

Workflow 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: EventEnvelope

Recording metadata for this event.

§activity_id: ActivityId

Deterministic activity identifier derived from the scheduling sequence position.

§activity_type: String

Activity type selected by workflow code.

§input: Payload

Opaque activity input payload.

§

ActivityStarted

An activity worker started executing an activity attempt.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§activity_id: ActivityId

Activity being executed.

§

ActivityCompleted

An activity completed successfully.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§activity_id: ActivityId

Activity that produced the result.

§result: Payload

Opaque activity result payload.

§

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: EventEnvelope

Recording metadata for this event.

§activity_id: ActivityId

Activity whose attempt failed.

§error: ActivityError

Classified activity failure.

§attempt: u32

One-based activity attempt number that produced this failure.

§

ActivityCancelled

An activity was cancelled as an explicit cancellation outcome.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§activity_id: ActivityId

Activity that was cancelled.

§

TimerStarted

A timer was scheduled to fire at a deterministic timestamp.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§timer_id: TimerId

Timer selected by workflow code or assigned by the engine.

§fire_at: DateTime<Utc>

UTC timestamp at which the timer becomes eligible to fire.

§

TimerFired

A timer fired.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§timer_id: TimerId

Timer that fired.

§

TimerCancelled

A timer was cancelled as an explicit cancellation outcome.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§timer_id: TimerId

Timer that was cancelled.

§

WithTimeoutCompleted

A with_timeout operation reached a durable terminal outcome.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§timer_id: TimerId

Timer that bounded the operation.

§outcome: WithTimeoutOutcome

Recorded timeout outcome.

§result: Option<Payload>

JSON-encoded BEAM term payload for completed operation results.

§

SignalReceived

A signal was delivered to the workflow.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§name: String

Signal name selected by the sender.

§payload: Payload

Opaque signal payload.

§

SignalSent

A signal was sent by this workflow to another workflow.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§target_workflow_id: WorkflowId

Target workflow identifier selected by workflow code.

§name: String

Signal name selected by workflow code.

§payload: Payload

Opaque signal payload.

§

ChildWorkflowStarted

A child workflow was started.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§child_workflow_id: WorkflowId

Child workflow identifier.

§workflow_type: String

Child workflow type selected by the parent.

§input: Payload

Opaque child workflow input payload.

§package_version: PackageVersion

Package 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: EventEnvelope

Recording metadata for this event.

§child_workflow_id: WorkflowId

Child workflow that produced the result.

§result: Payload

Opaque child workflow result payload.

§

ChildWorkflowFailed

A child workflow failed terminally.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§child_workflow_id: WorkflowId

Child workflow that failed.

§error: WorkflowError

Terminal child workflow failure.

§

ChildWorkflowCancelled

A child workflow was cancelled as an explicit cancellation outcome.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§child_workflow_id: WorkflowId

Child workflow that was cancelled.

§

ScheduleCreated

A schedule resource was created.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§schedule_id: ScheduleId

Schedule resource that was created.

§config: ScheduleConfig

Persisted schedule configuration.

§

ScheduleUpdated

A schedule resource was updated.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§schedule_id: ScheduleId

Schedule resource that was updated.

§config: ScheduleConfig

Updated schedule configuration.

§

SchedulePaused

A schedule resource was paused.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§schedule_id: ScheduleId

Schedule resource that was paused.

§

ScheduleResumed

A paused schedule resource was resumed.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§schedule_id: ScheduleId

Schedule resource that was resumed.

§

ScheduleDeleted

A schedule resource was deleted.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§schedule_id: ScheduleId

Schedule resource that was deleted.

§

ScheduleTriggered

A schedule tick started a workflow execution.

Fields

§envelope: EventEnvelope

Recording metadata for this event.

§schedule_id: ScheduleId

Schedule resource that fired.

§workflow_id: WorkflowId

Workflow execution started by the schedule tick.

§run_id: RunId

Run started by the schedule tick.

Implementations§

Source§

impl Event

Source

pub const fn envelope(&self) -> &EventEnvelope

Returns the envelope recorded with this event.

Source

pub const fn seq(&self) -> u64

Returns the monotonic sequence number recorded for this event.

Source

pub const fn recorded_at(&self) -> &DateTime<Utc>

Returns the deterministic recorded timestamp for this event.

Source

pub const fn workflow_id(&self) -> &WorkflowId

Returns the workflow history that owns this event.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Event

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Source§

impl TS for Event

Source§

type WithoutGenerics = Event

If this type does not have generic parameters, then 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 more
Source§

type OptionInnerType = Event

If the implementing type is 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 ident(cfg: &Config) -> String

Identifier of this type, excluding generic parameters.
Source§

fn docs() -> Option<String>

JSDoc comment to describe this type in TypeScript - when TS is derived, docs are automatically read from your doc comments or #[doc = ".."] attributes
Source§

fn name(cfg: &Config) -> String

Name of this type in TypeScript, including generic parameters
Source§

fn decl_concrete(cfg: &Config) -> String

Declaration of this type using the supplied generic arguments. The resulting TypeScript definition will not be generic. For that, see TS::decl(). If this type is not generic, then this function is equivalent to TS::decl().
Source§

fn decl(cfg: &Config) -> String

Declaration of this type, e.g. type User = { user_id: number, ... }. This function will panic if the type has no declaration. Read more
Source§

fn inline(cfg: &Config) -> String

Formats this types definition in TypeScript, e.g { user_id: number }. This function will panic if the type cannot be inlined.
Source§

fn inline_flattened(cfg: &Config) -> String

Flatten a type declaration. This function will panic if the type cannot be flattened.
Source§

fn visit_generics(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all type parameters of this type.
Source§

fn output_path() -> Option<PathBuf>

Returns the output path to where T should be exported, relative to the output directory. The returned path does not include any base directory. Read more
Source§

fn visit_dependencies(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all dependency of this type.
Source§

fn dependencies(cfg: &Config) -> Vec<Dependency>
where Self: 'static,

Resolves all dependencies of this type recursively.
Source§

fn export(cfg: &Config) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem. To export this type together with all of its dependencies, use TS::export_all. Read more
Source§

fn export_all(cfg: &Config) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem, together with all of its dependencies. To export only this type, without its dependencies, use TS::export. Read more
Source§

fn export_to_string(cfg: &Config) -> Result<String, ExportError>
where Self: 'static,

Manually generate bindings for this type, returning a String. This function does not format the output, even if the format feature is enabled. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.