Skip to main content

WorkflowSummary

Struct WorkflowSummary 

Source
pub struct WorkflowSummary {
Show 14 fields pub workflow_id: WorkflowId, pub run_id: RunId, pub workflow_type: String, pub status: WorkflowStatus, pub started_at: DateTime<Utc>, pub updated_at: DateTime<Utc>, pub ended_at: Option<DateTime<Utc>>, pub parent: Option<WorkflowId>, pub failed_step: Option<String>, pub failure_reason: Option<String>, pub display_name: Option<String>, pub kind: Option<String>, pub current_worker: Option<WorkerAttribution>, pub package_version: Option<PackageVersion>,
}
Expand description

Lightweight projection of a workflow execution for query results.

Fields§

§workflow_id: WorkflowId

Workflow execution identifier.

§run_id: RunId

The run this summary projects — the latest run of the workflow’s continue-as-new chain.

§workflow_type: String

Workflow type recorded when the execution started.

§status: WorkflowStatus

Status projected from authoritative workflow history.

§started_at: DateTime<Utc>

Timestamp recorded on the workflow start event.

§updated_at: DateTime<Utc>

Timestamp recorded on the run’s LATEST event of any kind — the instant the run last did anything durable. Advances on every append; a table sorted by it shows the most recently active runs first.

§ended_at: Option<DateTime<Utc>>

Timestamp recorded on the terminal lifecycle event, if any.

§parent: Option<WorkflowId>

Parent workflow identifier for child-workflow executions, if the store has one.

§failed_step: Option<String>

The step (activity type) that failed, populated ONLY for a workflow whose current-lease terminal is Event::WorkflowFailed and whose failure has a terminal activity failure to attribute it to (e.g. dev_review). This is the workflow step, never a brief id or label. None for every healthy/running/completed/cancelled workflow, so list renderers show no empty failure column for non-failed rows.

§failure_reason: Option<String>

The terminal WorkflowFailed error message, populated ONLY for a workflow whose current-lease terminal is Event::WorkflowFailed. None otherwise.

§display_name: Option<String>

The WORKFLOW’s operator-facing display name (#211), projected from the aion.display_name search attribute (last write wins, so a rename’s later recorded update supersedes the start-time name). A label over the UUID identity, never an address: None renders as the bare UUID.

Per workflow, not per run, unlike the rest of this summary: the recorded attribute carries no run id and the projection folds the whole history, so a continue-as-new successor’s summary carries the name its predecessor was wearing — see WorkflowSummary::from_history.

§kind: Option<String>

The run’s document kind (workloop brief, listing surface): "workloop" for workloop runs, None for ordinary workflows. Projected from the aion.kind search attribute exactly like display_name — additive, with NO change to WorkflowStatus. Folded per workflow, last write wins, so every generation of a loop’s continue-as-new chain wears it.

§current_worker: Option<WorkerAttribution>

The worker holding the run’s most recently leased open attempt (WA-010 R4): the LAST Event::ActivityLeased in the current lease segment whose attempt has no terminal since. Cleared when that attempt completes, fails, or is cancelled; when another attempt is still outstanding, that one is shown instead. See crate::lease_projection for the one fold every reader shares.

None is UNATTRIBUTED: no attempt is outstanding, the run was recorded before lease events existed, or this install knew the worker and failed to record it. The surface’s crate::ReadProvenance::lease_record_failures_total is how a reader tells the last two apart; the history alone cannot.

This is attribution BY THE RECORD, never a liveness claim: it names the worker the history says took the attempt, and it is cleared by the attempt’s recorded terminal, not by the worker letting go. A reader who needs “who is physically still on this” wants the heartbeat surface (crate::DescribeLiveResponse), not this fold.

§package_version: Option<PackageVersion>

The content hash of the package THIS run started under: the package_version recorded on the run’s own Event::WorkflowStarted, which is the 64-hex SHA-256 the loaded module is named by (logical_name$hash), never a logical version and never re-resolved. A reader that needs the exact document that produced this history fetches it by this hash; “whatever that type deploys to now” is a different artifact.

Per RUN, not per workflow: a continue-as-new successor reports the package it started under, which can differ from its predecessor’s.

None only for a visibility row written before the field existed. A summary folded from history always carries it (the event field is required), and no reader ever fills an absent value by looking up the type’s current version.

Implementations§

Source§

impl WorkflowSummary

Source

pub fn from_history(events: &[Event]) -> Option<WorkflowSummary>

Builds a workflow summary from a workflow event history.

Returns None when the history does not contain a Event::WorkflowStarted event. The projected status and end timestamp are derived from the current run in the history, matching status_from_events. Parent linkage (aion#77) is projected from the current run’s own recorded parent_workflow_id — the child wears its parent; histories recorded before the field decode to None.

failed_step and failure_reason are populated ONLY when the current lease’s terminal event is Event::WorkflowFailed (see failure_projection); a reopened, running, completed, or cancelled workflow leaves both None.

display_name (#211) is NOT scoped that way. It is folded over the whole history by crate::display_name, last write wins, and the recorded attribute carries no run id — so it is a per-WORKFLOW label even though the rest of this summary projects the current run. Hand this a history that continued as new and the successor’s summary carries the name its predecessor was wearing, until something renames it.

Trait Implementations§

Source§

impl Clone for WorkflowSummary

Source§

fn clone(&self) -> WorkflowSummary

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 WorkflowSummary

Source§

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

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

impl<'de> Deserialize<'de> for WorkflowSummary

Source§

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

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

impl Eq for WorkflowSummary

Source§

impl From<VisibilityRecord> for WorkflowSummary

Source§

fn from(record: VisibilityRecord) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for WorkflowSummary

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for WorkflowSummary

Source§

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

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

impl StructuralPartialEq for WorkflowSummary

Source§

impl TS for WorkflowSummary

Source§

type WithoutGenerics = WorkflowSummary

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 = WorkflowSummary

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 WorkflowSummary: '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 WorkflowSummary: '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§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more