pub struct ActivityEvent {
pub workflow_id: WorkflowId,
pub run_id: RunId,
pub activity_id: ActivityId,
pub attempt: u32,
pub agent_id: Uuid,
pub agent_role: String,
pub emitted_at: DateTime<Utc>,
pub worker_seq: u64,
pub store_seq: Option<u64>,
pub ephemeral: bool,
pub kind: ActivityEventKind,
}Expand description
A live transcript event for one (workflow, run, activity, attempt) produced by an agent
harness.
Streamed to the ops console in real time and persisted to a durable observability keyspace
(except Self::ephemeral events). It is never mixed into workflow replay history — the
activity’s single terminal result is the replay-authoritative output, not this transcript.
§The run axis is REQUIRED, not optional
A continue-as-new chain reuses one WorkflowId across generations while activity ordinals
restart at 0 and attempts restart at 1 in each new run. Without Self::run_id two
generations of one chain produce byte-identical stream identities, and their transcripts fuse:
generation two’s first event lands on generation one’s stream head. run_id is therefore a
plain required field — an Option would let the ambiguity back in through the None arm, and
there is no honest value to default it to. The same law already holds one layer over, where
the activity idempotency key is run-scoped over the identical triple.
§Ordering
Self::emitted_at and Self::worker_seq are best-effort producer-side ordering hints.
Self::store_seq is assigned by the server at durable-commit time and is None until the
event has been persisted — an unpersisted (e.g. ephemeral, or in-flight) event carries no
store sequence.
Fields§
§workflow_id: WorkflowIdThe workflow this activity belongs to.
run_id: RunIdThe concrete run of that workflow this event was produced in — the second stream axis.
Required. Two generations of one continue-as-new chain share a workflow_id and restart
their ordinals and attempts, so this is the only field that keeps their transcripts apart.
activity_id: ActivityIdThe activity within the workflow.
attempt: u32The attempt number of the activity this event was produced during.
agent_id: UuidSub-identity of the agent that produced this event — REQUIRED for multi-agent attribution (a single activity attempt may run several agents).
agent_role: StringThe role/label of the producing agent (e.g. an orchestrator vs a sub-agent).
emitted_at: DateTime<Utc>Producer-clock instant the event was emitted (best-effort ordering hint).
worker_seq: u64Worker-local best-effort monotonic sequence.
Exported to TypeScript as number; see the module docs for the accepted 2^53 ceiling.
store_seq: Option<u64>Server-stamped monotonic sequence assigned at durable-commit time; None until the event
is persisted (ephemeral events are never persisted and always carry None).
Exported to TypeScript as number; see the module docs for the accepted 2^53 ceiling.
ephemeral: boolWhen true, this event is WS-forward-only and is never persisted (token deltas).
kind: ActivityEventKindThe classified payload of this event.
Trait Implementations§
Source§impl Clone for ActivityEvent
impl Clone for ActivityEvent
Source§fn clone(&self) -> ActivityEvent
fn clone(&self) -> ActivityEvent
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 ActivityEvent
impl Debug for ActivityEvent
Source§impl<'de> Deserialize<'de> for ActivityEvent
impl<'de> Deserialize<'de> for ActivityEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ActivityEvent
impl PartialEq for ActivityEvent
Source§impl Serialize for ActivityEvent
impl Serialize for ActivityEvent
impl StructuralPartialEq for ActivityEvent
Source§impl TS for ActivityEvent
impl TS for ActivityEvent
Source§type WithoutGenerics = ActivityEvent
type WithoutGenerics = ActivityEvent
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 = ActivityEvent
type OptionInnerType = ActivityEvent
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
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: '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
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: '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