pub struct ExecutionResult {
pub proceed: bool,
pub outcome_value: Option<Value>,
pub sleep_for: Option<Duration>,
pub persistence_data: Option<Value>,
pub event_name: Option<String>,
pub event_key: Option<String>,
pub event_as_of: Option<DateTime<Utc>>,
pub branch_values: Option<Vec<Value>>,
pub poll_endpoint: Option<PollEndpointConfig>,
pub output_data: Option<Value>,
}Expand description
The result returned by a step’s run method.
ExecutionResult controls what the executor does next: proceed, branch, sleep,
wait for an event, or persist state for the next execution.
Fields§
§proceed: boolWhether the workflow should proceed to the next step.
outcome_value: Option<Value>Outcome value for decision-based routing.
sleep_for: Option<Duration>Duration to sleep before re-executing.
persistence_data: Option<Value>Step-specific state to persist between executions.
event_name: Option<String>Event name to wait for.
event_key: Option<String>Event key to match.
event_as_of: Option<DateTime<Utc>>Only consider events published after this time.
branch_values: Option<Vec<Value>>Values to branch execution on (for ForEach/Parallel).
poll_endpoint: Option<PollEndpointConfig>Poll endpoint configuration for external service polling.
output_data: Option<Value>Output data to merge into workflow.data after step completion.
Implementations§
Source§impl ExecutionResult
impl ExecutionResult
Sourcepub fn outcome(value: impl Into<Value>) -> Self
pub fn outcome(value: impl Into<Value>) -> Self
Continue with an outcome value for decision routing.
Sourcepub fn branch(values: Vec<Value>, persistence_data: Option<Value>) -> Self
pub fn branch(values: Vec<Value>, persistence_data: Option<Value>) -> Self
Create child branches for parallel/foreach execution.
Sourcepub fn sleep(duration: Duration, persistence_data: Option<Value>) -> Self
pub fn sleep(duration: Duration, persistence_data: Option<Value>) -> Self
Sleep for a duration before re-executing.
Sourcepub fn wait_for_event(
event_name: impl Into<String>,
event_key: impl Into<String>,
as_of: DateTime<Utc>,
) -> Self
pub fn wait_for_event( event_name: impl Into<String>, event_key: impl Into<String>, as_of: DateTime<Utc>, ) -> Self
Wait for an external event.
Sourcepub fn poll_endpoint(config: PollEndpointConfig) -> Self
pub fn poll_endpoint(config: PollEndpointConfig) -> Self
Poll an external endpoint until a condition is met.
Trait Implementations§
Source§impl Clone for ExecutionResult
impl Clone for ExecutionResult
Source§fn clone(&self) -> ExecutionResult
fn clone(&self) -> ExecutionResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more