pub struct WorkflowBuilder { /* private fields */ }Expand description
Builder for a Workflow. The executor is mandatory (it is the seam to the
host’s placement / scheduling); everything else is optional.
Implementations§
Source§impl WorkflowBuilder
impl WorkflowBuilder
Sourcepub fn new(executor: Arc<dyn AgentExecutor>) -> Self
pub fn new(executor: Arc<dyn AgentExecutor>) -> Self
Start a builder around executor (the default in-box executor is
AgentSession::agent_executor).
Sourcepub fn with_budget(self, budget: Arc<WorkflowBudget>) -> Self
pub fn with_budget(self, budget: Arc<WorkflowBudget>) -> Self
Attach the shared budget ledger this workflow reports on.
The SAME Arc<WorkflowBudget> must also be installed as the executor’s
child budget_guard (the in-box wiring is done by
AgentSession::workflow); the workflow
only reads it for budget_snapshot and to
emit WorkflowEvent::BudgetExhausted.
Sourcepub fn with_store(self, store: Arc<dyn SessionStore>) -> Self
pub fn with_store(self, store: Arc<dyn SessionStore>) -> Self
Persist progress so each phase becomes a resume
boundary. Without a store, phases run as plain (non-resumable) barriers.
Sourcepub fn with_step_events(self, step_events: Sender<AgentEvent>) -> Self
pub fn with_step_events(self, step_events: Sender<AgentEvent>) -> Self
Thread the per-step AgentEvent sender into every combinator call so
existing subagent/AHP/trace listeners observe child-run lifecycle events.
Sourcepub fn with_root_id(self, root_id: impl Into<String>) -> Self
pub fn with_root_id(self, root_id: impl Into<String>) -> Self
Set the stable root id used to derive per-phase checkpoint keys. Supply a deterministic id (e.g. session-derived) for resume to work across runs; otherwise a random id is used and resume is effectively disabled.
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowBuilder
impl !UnwindSafe for WorkflowBuilder
impl Freeze for WorkflowBuilder
impl Send for WorkflowBuilder
impl Sync for WorkflowBuilder
impl Unpin for WorkflowBuilder
impl UnsafeUnpin for WorkflowBuilder
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> 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