pub struct DynamicWorkflowTool { /* private fields */ }Expand description
Model-visible tool that executes a dynamic workflow through A3S Flow.
Implementations§
Source§impl DynamicWorkflowTool
impl DynamicWorkflowTool
pub fn new(registry: Arc<ToolRegistry>) -> Self
Sourcepub fn health(&self) -> DynamicWorkflowHealthSnapshot
pub fn health(&self) -> DynamicWorkflowHealthSnapshot
Return bounded cumulative worker-claim diagnostics for this tool instance. Durable per-run attempt state remains in the Flow ledger.
Sourcepub fn with_graph_observer(self, observer: FlowGraphObserver) -> Self
pub fn with_graph_observer(self, observer: FlowGraphObserver) -> Self
Project committed Flow events into an optional reactive state graph. A3S Flow remains the workflow execution source of truth.
Sourcepub fn with_flow_event_store(self, store: Arc<dyn FlowEventStore>) -> Self
pub fn with_flow_event_store(self, store: Arc<dyn FlowEventStore>) -> Self
Use a host-owned Flow event store for workflow history and control.
This is the extension point for remote or database-backed hosts. The
store must provide its own durable append/sequence contract; Code does
not mirror its events into a second journal or cache. When omitted,
local workspaces use CrossProcessFlowEventStore and non-local
contexts use a process-local in-memory store for compatibility.
Sourcepub fn with_task_scheduler(
self,
scheduler: Arc<TaskScheduler>,
admit_steps_globally: bool,
) -> Self
pub fn with_task_scheduler( self, scheduler: Arc<TaskScheduler>, admit_steps_globally: bool, ) -> Self
Configure optional global admission for direct script-backed Flow steps. Session-bound registrations should leave this disabled because the enclosing session operation already owns the global lease.
Sourcepub fn with_runtime_build_compatibility(
self,
compatibility: RuntimeBuildCompatibility,
) -> Self
pub fn with_runtime_build_compatibility( self, compatibility: RuntimeBuildCompatibility, ) -> Self
Fence new and resumed runs to an explicit runtime-build compatibility
set. By default the tool pins new runs to
DYNAMIC_WORKFLOW_RUNTIME_BUILD_ID and temporarily accepts legacy
unpinned histories; hosts that can replay older builds should add them
to this compatibility set explicitly.
Sourcepub fn with_continuation_lease_ledger(
self,
ledger: Arc<dyn FlowDecisionLedger>,
lease_ms: u64,
) -> Self
pub fn with_continuation_lease_ledger( self, ledger: Arc<dyn FlowDecisionLedger>, lease_ms: u64, ) -> Self
Use a caller-owned durable lease ledger for worker admission.
The ledger stores only claim metadata and digests; A3S Flow’s event
store remains the workflow source of truth. Hosts that run multiple
workers should provide a shared ledger (for example a
FileFlowDecisionLedger) and choose a lease long enough for one
heartbeat interval. Without an explicit ledger, local workspaces use a
sidecar file ledger and remote/in-memory contexts use a tool-scoped
memory ledger.
Sourcepub fn with_continuation_lease_ms(self, lease_ms: u64) -> Self
pub fn with_continuation_lease_ms(self, lease_ms: u64) -> Self
Change the default worker lease while retaining automatic ledger selection.
Sourcepub fn control(
&self,
run_id: impl Into<String>,
source: impl Into<String>,
input: Value,
ctx: &ToolContext,
) -> Result<DynamicWorkflowControl>
pub fn control( &self, run_id: impl Into<String>, source: impl Into<String>, input: Value, ctx: &ToolContext, ) -> Result<DynamicWorkflowControl>
Bind a host control handle to one durable run and its replay inputs.
The handle is intentionally separate from the model-visible tool call: a host must provide the exact source and initial input before it can inspect, drive, or cancel a run. No operation is performed until a method on the returned handle is awaited.
Trait Implementations§
Source§impl Tool for DynamicWorkflowTool
impl Tool for DynamicWorkflowTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 Value,
ctx: &'life2 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 Value,
ctx: &'life2 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Source§fn is_model_visible(&self) -> bool
fn is_model_visible(&self) -> bool
Source§fn capabilities(&self, _args: &Value) -> ToolCapabilities
fn capabilities(&self, _args: &Value) -> ToolCapabilities
Auto Trait Implementations§
impl !RefUnwindSafe for DynamicWorkflowTool
impl !UnwindSafe for DynamicWorkflowTool
impl Freeze for DynamicWorkflowTool
impl Send for DynamicWorkflowTool
impl Sync for DynamicWorkflowTool
impl Unpin for DynamicWorkflowTool
impl UnsafeUnpin for DynamicWorkflowTool
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