pub struct ScopedExecutionsClient { /* private fields */ }Expand description
Project-scoped execution operations. Obtained via
[crate::client::ProjectScope::executions].
Derefs to ExecutionsClient, so global methods (get, cancel,
resume, await_execution, document helpers) are available too.
Implementations§
Source§impl ScopedExecutionsClient
impl ScopedExecutionsClient
Sourcepub fn run(&self, script_name: &str) -> RunBuilder
pub fn run(&self, script_name: &str) -> RunBuilder
Start building a script run.
Sourcepub async fn run_stream(&self, req: RunBuilder) -> Result<RunStream>
pub async fn run_stream(&self, req: RunBuilder) -> Result<RunStream>
Subscribe to the SSE event stream first, then kick off a run, and
return a RunStream that yields typed WorkflowEvents until the
workflow terminates.
req is a RunBuilder (from Self::run) carrying the script
name, channel, inputs and other run parameters.
Sourcepub fn list(&self, script_name: &str) -> ListExecutionsBuilder
pub fn list(&self, script_name: &str) -> ListExecutionsBuilder
Start building an execution list query.
Sourcepub async fn cancel_run(&self, script_name: &str) -> Result<bool>
pub async fn cancel_run(&self, script_name: &str) -> Result<bool>
Cancel all running executions for a script; returns true if any were cancelled.
Sourcepub async fn cancel_all(&self, script_name: &str) -> Result<bool>
pub async fn cancel_all(&self, script_name: &str) -> Result<bool>
Cross-SDK naming alias for [cancel_run]. Mirrors the Python SDK’s
cancel_all; forwarded verbatim so callers porting examples across
SDKs don’t trip on the rename. Refs #109 (item 3: method-naming
consistency).
Sourcepub async fn run_from(
&self,
script_name: &str,
seed_env: HashMap<String, Value>,
skip_node_ids: Vec<usize>,
channel: Option<&str>,
inputs: Option<HashMap<String, Value>>,
triggered_by: Option<&str>,
) -> Result<RunResult>
pub async fn run_from( &self, script_name: &str, seed_env: HashMap<String, Value>, skip_node_ids: Vec<usize>, channel: Option<&str>, inputs: Option<HashMap<String, Value>>, triggered_by: Option<&str>, ) -> Result<RunResult>
Run a script from a specific point with pre-seeded environment values.
Sourcepub async fn get_graph(
&self,
script_name: &str,
version_id: Option<i64>,
) -> Result<GraphResponse>
pub async fn get_graph( &self, script_name: &str, version_id: Option<i64>, ) -> Result<GraphResponse>
Get the compiled execution DAG for a script.
Sourcepub async fn get_project_cost(
&self,
since: Option<&str>,
until: Option<&str>,
) -> Result<ProjectCost>
pub async fn get_project_cost( &self, since: Option<&str>, until: Option<&str>, ) -> Result<ProjectCost>
Get cost aggregation for the entire project.
Sourcepub async fn get_cost(&self, script_name: &str) -> Result<CostAggregation>
pub async fn get_cost(&self, script_name: &str) -> Result<CostAggregation>
Get cost aggregation for a script.
Methods from Deref<Target = ExecutionsClient>§
Sourcepub async fn resume(
&self,
execution_id: &str,
token: &str,
data: Value,
) -> Result<Value>
pub async fn resume( &self, execution_id: &str, token: &str, data: Value, ) -> Result<Value>
Resume a suspended checkpoint within a running execution.
Sourcepub async fn cancel(&self, execution_id: &str) -> Result<bool>
pub async fn cancel(&self, execution_id: &str) -> Result<bool>
Cancel a specific execution by ID; returns true if it was cancelled.
Sourcepub async fn children(
&self,
execution_id: &str,
) -> Result<Vec<ExecutionChildSummary>>
pub async fn children( &self, execution_id: &str, ) -> Result<Vec<ExecutionChildSummary>>
List child executions spawned by execution_id via the engine’s
spawn_child_execution callback (#1054). Returns an empty Vec when
no children exist (the common case for v1 where parent-linkage
columns are typically NULL). Mirrors TS executions.children and
Python executions.children.
Sourcepub async fn get(&self, execution_id: &str) -> Result<Option<ExecutionStatus>>
pub async fn get(&self, execution_id: &str) -> Result<Option<ExecutionStatus>>
Fetch the full status record for an execution.
Sourcepub async fn tasks(
&self,
execution_id: &str,
) -> Result<Option<ExecutionTasksResponse>>
pub async fn tasks( &self, execution_id: &str, ) -> Result<Option<ExecutionTasksResponse>>
Per-task cost / token / duration breakdown for an execution
(GET /executions/{id}/tasks). Reads from the execution_tasks
table populated as TaskEnd events arrive, so callers don’t have to
parse the event JSON to recover this data. Useful for monolith
workflows where there are no spawned children — every agent
invocation lives in execution_tasks keyed by task_name.
404 → Ok(None) (the execution doesn’t exist or isn’t accessible to
this token), matching get / get_output. Mirrors the TS SDK’s
executions.tasks.
Sourcepub async fn get_output(
&self,
execution_id: &str,
) -> Result<Option<ExecutionOutput>>
pub async fn get_output( &self, execution_id: &str, ) -> Result<Option<ExecutionOutput>>
Fetch only the output (status, error, result) for an execution.
Sourcepub async fn get_events(
&self,
execution_id: &str,
after_id: Option<i64>,
limit: Option<i64>,
types: Option<&str>,
) -> Result<Option<ExecutionEvents>>
pub async fn get_events( &self, execution_id: &str, after_id: Option<i64>, limit: Option<i64>, types: Option<&str>, ) -> Result<Option<ExecutionEvents>>
Return the persisted event stream for an execution. types is an
optional comma-separated allowlist ("TaskEnd,Error,WorkflowEnd")
that lets callers slim down responses on long workflows.
Sourcepub async fn get_document(
&self,
document_id: &str,
) -> Result<Option<DocumentMeta>>
pub async fn get_document( &self, document_id: &str, ) -> Result<Option<DocumentMeta>>
Get document metadata by ID.
Sourcepub async fn get_document_markdown(&self, document_id: &str) -> Result<String>
pub async fn get_document_markdown(&self, document_id: &str) -> Result<String>
Get converted markdown for a document.
Sourcepub async fn get_document_url(&self, document_id: &str) -> Result<String>
pub async fn get_document_url(&self, document_id: &str) -> Result<String>
Get a presigned download URL for the original document file.
Sourcepub async fn reconvert_document(&self, document_id: &str) -> Result<Value>
pub async fn reconvert_document(&self, document_id: &str) -> Result<Value>
Retry conversion on a failed document.
Sourcepub async fn run_from_node(
&self,
project_id: i64,
script_name: &str,
seed_env: HashMap<String, Value>,
skip_node_ids: Vec<usize>,
channel: Option<&str>,
inputs: Option<HashMap<String, Value>>,
) -> Result<RunResult>
pub async fn run_from_node( &self, project_id: i64, script_name: &str, seed_env: HashMap<String, Value>, skip_node_ids: Vec<usize>, channel: Option<&str>, inputs: Option<HashMap<String, Value>>, ) -> Result<RunResult>
Run a script from a specific point with pre-seeded environment values.
Convenience wrapper that doesn’t require building a ScopedExecutionsClient
first — useful for callers (e.g. akribes-mcp) that already know the
project_id numerically. Forwards to
ScopedExecutionsClient::run_from.
seed_env carries pre-computed variable values for nodes already
completed by a prior execution; skip_node_ids lists those node IDs
so the engine skips re-running them. channel defaults to draft.
Sourcepub async fn await_execution(
&self,
execution_id: &str,
timeout_ms: Option<u64>,
poll_interval_ms: Option<u64>,
) -> Result<ExecutionOutput>
pub async fn await_execution( &self, execution_id: &str, timeout_ms: Option<u64>, poll_interval_ms: Option<u64>, ) -> Result<ExecutionOutput>
Poll get_output until the execution reaches a terminal state.
Sourcepub async fn await_result(
&self,
execution_id: &str,
timeout_ms: Option<u64>,
poll_interval_ms: Option<u64>,
) -> Result<ExecutionOutput>
pub async fn await_result( &self, execution_id: &str, timeout_ms: Option<u64>, poll_interval_ms: Option<u64>, ) -> Result<ExecutionOutput>
Cross-SDK naming alias for [await_execution]. Mirrors the Python
SDK’s await_result; forwarded verbatim so callers porting examples
across SDKs don’t trip on the rename. Refs #109 (item 3:
method-naming consistency).
Trait Implementations§
Source§impl Clone for ScopedExecutionsClient
impl Clone for ScopedExecutionsClient
Source§fn clone(&self) -> ScopedExecutionsClient
fn clone(&self) -> ScopedExecutionsClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more