pub enum WorkflowEvent {
Show 14 variants
Started,
Status(WorkflowRunState),
SuperStepStarted(usize),
SuperStepCompleted(usize),
ExecutorInvoked {
executor_id: String,
},
ExecutorCompleted {
executor_id: String,
},
ExecutorFailed {
executor_id: String,
error: String,
},
AgentRunUpdate {
executor_id: String,
update: Value,
},
AgentRun {
executor_id: String,
response: Value,
},
Output {
data: Value,
source_executor_id: String,
},
Intermediate {
data: Value,
source_executor_id: String,
},
Custom(Value),
RequestInfo {
request_id: String,
source_executor_id: String,
request_data: Value,
},
Failed {
error: String,
},
}Expand description
An event observed while a workflow runs.
Corresponds to the WorkflowEvent hierarchy in the Python engine. Only
workflow-level events are observable; inter-executor messages are internal.
Variant names map onto Python types as noted (e.g. WorkflowEvent::Started
is WorkflowStartedEvent, WorkflowEvent::Output is WorkflowOutputEvent).
Variants§
Started
The run has begun (WorkflowStartedEvent).
Status(WorkflowRunState)
A run-state transition (WorkflowStatusEvent).
SuperStepStarted(usize)
A superstep has started, with its 1-based iteration index.
SuperStepCompleted(usize)
A superstep has completed, with its 1-based iteration index.
ExecutorInvoked
An executor began processing a message (ExecutorInvokedEvent).
ExecutorCompleted
An executor finished processing (ExecutorCompletedEvent).
ExecutorFailed
An executor failed (ExecutorFailedEvent).
AgentRunUpdate
An agent produced an incremental streaming update (AgentRunUpdateEvent).
AgentRun
An agent completed a run (AgentRunEvent).
Output
A workflow-level output was yielded (WorkflowOutputEvent).
Terminal: recorded as (part of) the run’s final output. Emitted for
yields from an executor named by
WorkflowBuilder::output_from,
or from any executor when no output designation is configured at all
(see WorkflowEvent::Intermediate for the non-terminal counterpart).
Intermediate
A non-terminal, workflow-level progress signal.
Mirrors upstream’s intermediate yield classification: emitted for
yields from an executor named by
WorkflowBuilder::intermediate_output_from,
and (when an output_from allowlist is configured) for yields from any
executor not on that allowlist, as a safe non-terminal fallback. Never
recorded as the run’s final output (WorkflowRun::last_output
ignores it).
Custom(Value)
A custom event added by an executor.
RequestInfo
A request for external input, human-in-the-loop (RequestInfoEvent).
Fields
Failed
The run failed terminally (WorkflowFailedEvent).
Implementations§
Source§impl WorkflowEvent
impl WorkflowEvent
Sourcepub fn as_output(&self) -> Option<&Value>
pub fn as_output(&self) -> Option<&Value>
If this is an WorkflowEvent::Output, return the data.
Sourcepub fn as_intermediate(&self) -> Option<&Value>
pub fn as_intermediate(&self) -> Option<&Value>
If this is a WorkflowEvent::Intermediate, return the data.
Sourcepub fn as_request_info(&self) -> Option<(&str, &Value)>
pub fn as_request_info(&self) -> Option<(&str, &Value)>
If this is a WorkflowEvent::RequestInfo, return (request_id, data).
Sourcepub fn as_status(&self) -> Option<WorkflowRunState>
pub fn as_status(&self) -> Option<WorkflowRunState>
If this is a WorkflowEvent::Status, return the state.
Trait Implementations§
Source§impl Clone for WorkflowEvent
impl Clone for WorkflowEvent
Source§fn clone(&self) -> WorkflowEvent
fn clone(&self) -> WorkflowEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more