pub struct WorkflowRunEngine { /* private fields */ }Implementations§
Source§impl WorkflowRunEngine
impl WorkflowRunEngine
pub fn new( repository: Arc<dyn WorkflowRunRepository>, tools: Arc<dyn ToolExecutor>, agents: Arc<dyn AgentStepPort>, definitions: Arc<dyn WorkflowDefinitionPort>, policy: Arc<dyn WorkflowPolicyPort>, secrets: Arc<dyn WorkflowSecretResolverPort>, ceilings: WorkflowBudgets, ) -> Arc<Self> ⓘ
pub fn set_session_permission_port( &self, port: Arc<dyn WorkflowSessionPermissionPort>, )
pub async fn run( self: &Arc<Self>, request: StartWorkflowRun, ) -> Result<WorkflowRunSnapshot, WorkflowRunError>
pub async fn run_pinned( self: &Arc<Self>, request: StartWorkflowRun, bundle: WorkflowDefinitionBundle, ) -> Result<WorkflowRunSnapshot, WorkflowRunError>
Sourcepub async fn start(
self: &Arc<Self>,
request: StartWorkflowRun,
) -> Result<WorkflowRunSnapshot, WorkflowRunError>
pub async fn start( self: &Arc<Self>, request: StartWorkflowRun, ) -> Result<WorkflowRunSnapshot, WorkflowRunError>
Start in the background and return only after the running snapshot is durable. HTTP and tool adapters use this non-blocking entrypoint.
pub async fn start_pinned( self: &Arc<Self>, request: StartWorkflowRun, bundle: WorkflowDefinitionBundle, ) -> Result<WorkflowRunSnapshot, WorkflowRunError>
Sourcepub async fn restart(
self: &Arc<Self>,
run_id: &str,
workspace_trusted: bool,
allowed_capabilities: Vec<String>,
) -> Result<WorkflowRunSnapshot, WorkflowRunError>
pub async fn restart( self: &Arc<Self>, run_id: &str, workspace_trusted: bool, allowed_capabilities: Vec<String>, ) -> Result<WorkflowRunSnapshot, WorkflowRunError>
Phase-1 safe restart starts a fresh run from the suspended run’s pinned definition snapshot. Entered-step replay and script resume remain out of scope.
Sourcepub fn completed_prefix(
snapshot: &WorkflowRunSnapshot,
) -> Result<usize, WorkflowRunError>
pub fn completed_prefix( snapshot: &WorkflowRunSnapshot, ) -> Result<usize, WorkflowRunError>
Validate an unentered suffix using only the durable checkpoint. This is also the metadata predicate; invocation authority is checked separately.
Sourcepub async fn continue_completed_prefix(
self: &Arc<Self>,
run_id: &str,
session_id: &str,
workspace_trusted: bool,
allowed_capabilities: Vec<String>,
) -> Result<WorkflowRunSnapshot, WorkflowRunError>
pub async fn continue_completed_prefix( self: &Arc<Self>, run_id: &str, session_id: &str, workspace_trusted: bool, allowed_capabilities: Vec<String>, ) -> Result<WorkflowRunSnapshot, WorkflowRunError>
Explicitly continue the same readonly run; no entered step is replayed. The original created_at + wall_time_ms deadline includes time offline.
pub async fn progress( &self, run_id: &str, since: u64, ) -> Result<WorkflowProgress, WorkflowRunError>
pub async fn list_run_ids(&self) -> Result<Vec<String>, WorkflowRunError>
Sourcepub fn is_run_active(&self, run_id: &str) -> bool
pub fn is_run_active(&self, run_id: &str) -> bool
Whether the in-process worker for run_id is still executing.
A terminal durable snapshot can become visible just before the worker’s final registration guard is released. Shutdown/restart coordination can use this boundary to avoid opening a second repository owner while the old worker is still finishing its journal commit.
Sourcepub fn is_session_active(&self, session_id: &str) -> bool
pub fn is_session_active(&self, session_id: &str) -> bool
Includes workers whose terminal snapshot is visible but whose cleanup has not drained. Adapters fence Session scope changes until this ends.