pub struct Workflow { /* private fields */ }Expand description
A cheaply-clonable (all-Arc) typed orchestration facade.
Every verb delegates to exactly one existing combinator; Workflow owns no
scheduling or LLM logic. It is Clone so a phase can itself spawn
sub-workflows that share the same event bus, store, and phase numbering.
Implementations§
Source§impl Workflow
impl Workflow
Sourcepub fn builder(executor: Arc<dyn AgentExecutor>) -> WorkflowBuilder
pub fn builder(executor: Arc<dyn AgentExecutor>) -> WorkflowBuilder
Begin building a workflow around executor.
Sourcepub fn budget_snapshot(&self) -> Option<BudgetSnapshot>
pub fn budget_snapshot(&self) -> Option<BudgetSnapshot>
A snapshot of the shared budget ledger, if a budget is attached.
Sourcepub fn subscribe(&self) -> Receiver<WorkflowEvent>
pub fn subscribe(&self) -> Receiver<WorkflowEvent>
Subscribe to this workflow’s WorkflowEvent milestones.
Sourcepub async fn agent(&self, spec: AgentStepSpec) -> StepOutcome
pub async fn agent(&self, spec: AgentStepSpec) -> StepOutcome
Run a single step. A one-element barrier — reuses the panic isolation and
placement of parallel so one and many steps share a
single code path.
Sourcepub async fn parallel(&self, specs: Vec<AgentStepSpec>) -> Vec<StepOutcome>
pub async fn parallel(&self, specs: Vec<AgentStepSpec>) -> Vec<StepOutcome>
Barrier fan-out. Bounded by the executor’s
concurrency_hint; input order is
preserved and a panicked branch becomes a failed StepOutcome.
Sourcepub async fn phase(
&self,
name: &str,
specs: Vec<AgentStepSpec>,
) -> Vec<StepOutcome>
pub async fn phase( &self, name: &str, specs: Vec<AgentStepSpec>, ) -> Vec<StepOutcome>
A named barrier and a resume boundary.
Emits WorkflowEvent::PhaseStart/WorkflowEvent::PhaseEnd around the
inner combinator. When a store is configured the phase runs through
execute_steps_parallel_resumable keyed by a deterministic
"{root_id}/{index}:{name}" id, so an interrupted run skips already
completed steps; otherwise it is a plain parallel.
Sourcepub async fn pipeline<I>(
&self,
items: Vec<I>,
stages: Vec<PipelineStage<I>>,
) -> Vec<Option<StepOutcome>>where
I: Send + 'static,
pub async fn pipeline<I>(
&self,
items: Vec<I>,
stages: Vec<PipelineStage<I>>,
) -> Vec<Option<StepOutcome>>where
I: Send + 'static,
Per-item staged chains with no barrier between stages — delegates
straight to execute_pipeline. Item A may be in stage 3 while item B is
still in stage 1.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Workflow
impl !UnwindSafe for Workflow
impl Freeze for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnsafeUnpin for Workflow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more