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: WorkflowIdWorkflow execution identifier.
run_id: RunIdThe run this summary projects — the latest run of the workflow’s continue-as-new chain.
workflow_type: StringWorkflow type recorded when the execution started.
status: WorkflowStatusStatus 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
impl WorkflowSummary
Sourcepub fn from_history(events: &[Event]) -> Option<WorkflowSummary>
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
impl Clone for WorkflowSummary
Source§fn clone(&self) -> WorkflowSummary
fn clone(&self) -> WorkflowSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowSummary
impl Debug for WorkflowSummary
Source§impl<'de> Deserialize<'de> for WorkflowSummary
impl<'de> Deserialize<'de> for WorkflowSummary
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WorkflowSummary, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WorkflowSummary, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for WorkflowSummary
Source§impl From<VisibilityRecord> for WorkflowSummary
impl From<VisibilityRecord> for WorkflowSummary
Source§fn from(record: VisibilityRecord) -> Self
fn from(record: VisibilityRecord) -> Self
Source§impl PartialEq for WorkflowSummary
impl PartialEq for WorkflowSummary
Source§impl Serialize for WorkflowSummary
impl Serialize for WorkflowSummary
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for WorkflowSummary
Source§impl TS for WorkflowSummary
impl TS for WorkflowSummary
Source§type WithoutGenerics = WorkflowSummary
type WithoutGenerics = WorkflowSummary
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 = WorkflowSummary
type OptionInnerType = WorkflowSummary
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
WorkflowSummary: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
WorkflowSummary: '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
WorkflowSummary: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
WorkflowSummary: '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