#[non_exhaustive]pub struct FlowSnapshot {Show 14 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>,
pub edge_groups: Vec<EdgeGroupSnapshot>,
}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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.flow_id: FlowId§flow_kind: StringThe flow_kind literal passed to create_flow (e.g. dag,
pipeline). Preserved as-is; FF does not interpret it.
namespace: Namespace§public_flow_state: StringAuthoritative flow state on flow_core. See the struct-level
docs for the set of known values.
graph_revision: u64Monotonically increasing revision bumped on every structural
mutation (add-member, stage-edge). Used by optimistic-concurrency
writers via expected_graph_revision.
node_count: u32Number of member executions added so far. Never decremented.
edge_count: u32Number of dependency edges staged so far. Never decremented.
created_at: TimestampMs§last_mutation_at: TimestampMsTimestamp 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.
Consumer-owned namespaced metadata (e.g. cairn.task_id). See
the struct-level docs for the routing rule.
edge_groups: Vec<EdgeGroupSnapshot>RFC-016 Stage A: inbound edge groups known on this flow.
One entry per downstream execution that has at least one staged
inbound dependency edge. Populated from the
ff:flow:{fp:N}:<flow_id>:edgegroup:<downstream_eid> hash —
when that hash is absent (existing flows created before Stage A),
the backend falls back to reading the legacy
deps_meta.unsatisfied_required_count counter on the
downstream’s exec partition and reports the group as
EdgeDependencyPolicy::AllOf with the derived counters
(backward-compat shim — see RFC-016 §11 Stage A).
Every entry in Stage A reports policy = AllOf; Stage B/C/D/E
extend the variants and wire the quorum counters.
Implementations§
Source§impl FlowSnapshot
impl FlowSnapshot
Sourcepub 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>,
edge_groups: Vec<EdgeGroupSnapshot>,
) -> Self
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>, edge_groups: Vec<EdgeGroupSnapshot>, ) -> 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
impl Clone for FlowSnapshot
Source§fn clone(&self) -> FlowSnapshot
fn clone(&self) -> FlowSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more