Skip to main content

FlowSnapshot

Struct FlowSnapshot 

Source
#[non_exhaustive]
pub struct FlowSnapshot {
Show 13 fields pub flow_id: FlowId, pub flow_kind: String, pub namespace: Namespace, pub public_flow_state: String, pub graph_revision: u64, pub node_count: u32, pub edge_count: u32, pub created_at: TimestampMs, pub last_mutation_at: TimestampMs, pub cancelled_at: Option<TimestampMs>, pub cancel_reason: Option<String>, pub cancellation_policy: Option<String>, pub tags: BTreeMap<String, String>,
}
Expand description

Engine-decoupled read-model for one flow.

Returned by ff_sdk::FlowFabricWorker::describe_flow. Consumers consult this struct instead of reaching into Valkey’s flow_core hash directly — the engine is free to rename fields or restructure storage under this surface.

#[non_exhaustive] — FF may add fields in minor releases without a semver break. Match with .. or use FlowSnapshot::new.

§public_flow_state

Stored as an engine-written string literal on flow_core. Known values today: open, running, blocked, cancelled, completed, failed. Surfaced as String (not a typed enum) because FF does not yet expose a PublicFlowState type — callers that need to act on specific values should match on the literal. The flow_projector writes a parallel public_flow_state into the flow’s summary hash; this field reflects the authoritative value on flow_core, which is what mutation guards (cancel/add-member) consult.

§tags

Unlike ExecutionSnapshot::tags (which has a dedicated tags hash), flow tags live inline on flow_core. FF’s own fields are snake_case without a .; any field whose name starts with <lowercase>. (e.g. cairn.task_id) is treated as consumer-owned metadata and routed here. An empty map means no namespaced tags were written. The prefix convention mirrors ExecutionSnapshot::tags — consumers should keep tag keys namespaced (cairn.*, operator.*, etc.) so future FF field additions don’t collide.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§flow_id: FlowId§flow_kind: String

The flow_kind literal passed to create_flow (e.g. dag, pipeline). Preserved as-is; FF does not interpret it.

§namespace: Namespace§public_flow_state: String

Authoritative flow state on flow_core. See the struct-level docs for the set of known values.

§graph_revision: u64

Monotonically increasing revision bumped on every structural mutation (add-member, stage-edge). Used by optimistic-concurrency writers via expected_graph_revision.

§node_count: u32

Number of member executions added so far. Never decremented.

§edge_count: u32

Number of dependency edges staged so far. Never decremented.

§created_at: TimestampMs§last_mutation_at: TimestampMs

Timestamp of the last write that mutated flow_core. Engine-maintained.

§cancelled_at: Option<TimestampMs>

When the flow reached a terminal state via cancel_flow. None while the flow is live. Only written by the cancel path today; completed/failed terminal states do not populate this field (the flow_projector derives them from membership).

§cancel_reason: Option<String>

Operator-supplied reason from the cancel_flow call. None when the flow has not been cancelled.

§cancellation_policy: Option<String>

The cancellation_policy value persisted by cancel_flow (e.g. cancel_all, cancel_flow_only). None for flows cancelled before this field was persisted, or not yet cancelled.

§tags: BTreeMap<String, String>

Consumer-owned namespaced metadata (e.g. cairn.task_id). See the struct-level docs for the routing rule.

Implementations§

Source§

impl FlowSnapshot

Source

pub fn new( flow_id: FlowId, flow_kind: String, namespace: Namespace, public_flow_state: String, graph_revision: u64, node_count: u32, edge_count: u32, created_at: TimestampMs, last_mutation_at: TimestampMs, cancelled_at: Option<TimestampMs>, cancel_reason: Option<String>, cancellation_policy: Option<String>, tags: BTreeMap<String, String>, ) -> Self

Construct a FlowSnapshot. Present so downstream crates (ff-sdk’s describe_flow) can assemble the struct despite the #[non_exhaustive] marker.

Trait Implementations§

Source§

impl Clone for FlowSnapshot

Source§

fn clone(&self) -> FlowSnapshot

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FlowSnapshot

Source§

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

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

impl PartialEq for FlowSnapshot

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Eq for FlowSnapshot

Source§

impl StructuralPartialEq for FlowSnapshot

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