> For the complete documentation index, see [llms.txt](https://docs.talus.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talus.network/talus-docs-v2.1.0/reference/sdk/actions-workflow.md).

# Workflow Actions

**Audience:** Nexus SDK integrators (Rust).

**Area:** Workflow actions.

**Generated from:** Nexus SDK workflow API at release `v2.1.0` commit `45d397aafcfbeeeaf5032d5fb9fa5d99b3f36205`; the generated inventory is preserved and 2.1.0 state/recovery helpers are source-verified.

The inventory below is the public Workflow surface. Older ticket/cashier compatibility APIs are historical and are not part of the documented declarations. `WorkflowActions::settle_committed_tool_result_for_walk` uses a PTB that settles the exact Invocation and then invokes `emit_payment_ready_walk_requests` before optional Task settlement, so every active walk whose payment is ready can be requested in the same transaction.

### Recovery and causal reads

Use `RecoveryWindow` to prove the retained checkpoint interval before scanning recent activity. `WorkObjects` and `discover_work_objects` identify Task and Execution objects from that interval; they do not reconstruct pruned history. Pair discovered IDs with `TransactionUpdate`, `TransactionStateOutput`, and context-bound object reads, and preserve the checkpoint, digest, object version, and error classification in the diagnostic record.

### Source-derived public API inventory

#### `RecoveryWindow`

```rust
pub struct RecoveryWindow {
    /// Inclusive lower checkpoint.
    pub start: u64,
    /// Inclusive upper checkpoint captured before discovery.
    pub tip: u64,
    /// Chain timestamp at `tip`, in milliseconds since the Unix epoch.
    pub timestamp_ms: u64,
}
```

#### `RecoveryWindow::load`

```rust
pub async fn load(rpc_url: &str, lookback: Duration) -> anyhow::Result<Self> {
```

#### `RecoveryWindow::checkpoint_at`

```rust
pub async fn checkpoint_at(&self, rpc_url: &str, timestamp_ms: u64) -> anyhow::Result<u64> {
```

#### `WorkObjects`

```rust
pub struct WorkObjects {
    /// Current Task anchors. Their bounded in flight tables can name older executions.
    pub tasks: BTreeSet<sui::types::Address>,
    /// Current Execution anchors. Their state identifies the owning Task.
    pub executions: BTreeSet<sui::types::Address>,
}
```

#### `discover_work_objects`

```rust
pub async fn discover_work_objects(
    rpc_url: &str,
    context: &NexusContext,
    window: RecoveryWindow,
    concurrency: NonZeroUsize,
) -> anyhow::Result<WorkObjects> {
```

#### `EXPIRED_WALK_NOT_DOUBLE_TIMEOUT_EXPIRED_REASON`

```rust
pub const EXPIRED_WALK_NOT_DOUBLE_TIMEOUT_EXPIRED_REASON: &str =
    "walk is not double timeout expired";
```

#### `EXPIRED_WALK_ALREADY_TERMINAL_REASON`

```rust
pub const EXPIRED_WALK_ALREADY_TERMINAL_REASON: &str = "walk is already terminal";
```

#### `PublishResult`

```rust
pub struct PublishResult {
    pub tx_digest: sui::types::Digest,
    pub tx_checkpoint: u64,
    pub dag_object_id: sui::types::Address,
}
```

#### `InvocationPolicy`

```rust
pub enum InvocationPolicy {
    FixedPrice,
    FiniteCredits,
    TimePass,
    Custom(InvocationPolicyCall),
}
```

#### `AuthorizeInvocationResult`

```rust
pub struct AuthorizeInvocationResult {
    pub tx_digest: sui::types::Digest,
    pub tx_checkpoint: u64,
    /// Complete accounting identity emitted by the successful lock.
    pub lock: InvocationLockedEvent,
}
```

#### `DagSnapshot`

```rust
pub struct DagSnapshot {
    pub dag_id: sui::types::Address,
    pub vertex_count: u64,
    pub entry_groups: BTreeMap<String, BTreeMap<String, Vec<String>>>,
    pub vertex_meta_schemas: BTreeMap<String, MetaSchema>,
}
```

#### `InvocationAbortCandidate`

```rust
pub struct InvocationAbortCandidate {
    pub walk_index: usize,
    pub vertex: RuntimeVertex,
    pub payment_vertex_key: Vec<u8>,
    pub invocation_ref: sui::types::ObjectReference,
}
```

#### `AbortExpiredExecutionResult`

```rust
pub struct AbortExpiredExecutionResult {
    pub tx_digest: sui::types::Digest,
    pub tx_checkpoint: u64,
    pub dag_id: sui::types::Address,
    pub dag_execution_id: sui::types::Address,
    pub selected_candidate: InvocationAbortCandidate,
}
```

#### `AbortExecutionResult`

```rust
pub struct AbortExecutionResult {
    pub tx_digest: sui::types::Digest,
    pub tx_checkpoint: u64,
    pub dag_id: sui::types::Address,
    pub dag_execution_id: sui::types::Address,
    pub cleaned_broken_onchain_results: Vec<BrokenOnchainToolResultCleanup>,
}
```

#### `SettleCommittedToolResultParams`

```rust
pub struct SettleCommittedToolResultParams {
    pub dag_execution_id: sui::types::Address,
    pub walk_index: u64,
}
```

#### `ResolveExpiredWalkParams`

```rust
pub struct ResolveExpiredWalkParams {
    pub dag_execution_id: sui::types::Address,
    pub walk_index: u64,
    pub invocation_id: Option<sui::types::Address>,
}
```

#### `ExpiredWalkResolutionKind`

```rust
pub enum ExpiredWalkResolutionKind {
    Settled {
        expected_vertex: RuntimeVertex,
        invocation_ref: sui::types::ObjectReference,
    },
    SettledOnchainResult {
        result_ref: sui::types::ObjectReference,
        expected_vertex: RuntimeVertex,
        invocation_ref: sui::types::ObjectReference,
        tool_witness_id: sui::types::Address,
        finalize_tx_digest: Vec<u8>,
    },
    Aborted,
    AbortedWithInvocation {
        selected_candidate: InvocationAbortCandidate,
    },
    Skipped {
        reason: String,
    },
}
```

#### `ExpiredWalkResolutionKind::as_str`

```rust
pub fn as_str(&self) -> &'static str {
```

#### `ExpiredWalkResolutionKind::selected_candidate`

```rust
pub fn selected_candidate(&self) -> Option<&InvocationAbortCandidate> {
```

#### `ExpiredWalkResolutionKind::skip_reason`

```rust
pub fn skip_reason(&self) -> Option<&str> {
```

#### `ExpiredWalkResolutionPlan`

```rust
pub struct ExpiredWalkResolutionPlan {
    pub dag_id: sui::types::Address,
    pub dag_execution_id: sui::types::Address,
    pub walk_index: u64,
    pub kind: ExpiredWalkResolutionKind,
}
```

#### `ExpiredWalkResolutionResult`

```rust
pub struct ExpiredWalkResolutionResult {
    pub tx_digest: Option<sui::types::Digest>,
    pub tx_checkpoint: Option<u64>,
    pub dag_id: sui::types::Address,
    pub dag_execution_id: sui::types::Address,
    pub walk_index: u64,
    pub resolution_kind: ExpiredWalkResolutionKind,
}
```

#### `SettleCommittedToolResultByLeaderParams`

```rust
pub struct SettleCommittedToolResultByLeaderParams {
    pub dag_execution_id: sui::types::Address,
    pub leader_cap_id: sui::types::Address,
    pub walk_index: u64,
    /// Exact active vertex when merging failed on-chain Tool evidence.
    pub expected_vertex: Option<RuntimeVertex>,
    /// Sanitized failed on-chain Tool reason. Must be paired with `expected_vertex`.
    pub failed_onchain_tool_reason: Option<Vec<u8>>,
    pub commit_tx_digest: Vec<u8>,
    pub commit_gas_charge: u64,
    pub settlement_gas_charge: u64,
}
```

#### `RecordCommittedToolResultGasChargeParams`

```rust
pub struct RecordCommittedToolResultGasChargeParams {
    pub dag_execution_id: sui::types::Address,
    pub leader_cap_id: sui::types::Address,
    pub walk_index: u64,
    /// Exact active vertex when creating or merging failed on-chain tool evidence.
    pub expected_vertex: Option<RuntimeVertex>,
    /// Sanitized failed on-chain tool reason. Must be paired with `expected_vertex`.
    pub failed_onchain_tool_reason: Option<Vec<u8>>,
    pub commit_tx_digest: Vec<u8>,
    pub commit_gas_charge: u64,
    pub settlement_gas_charge: u64,
}
```

#### `CommittedToolResultSettlementResult`

```rust
pub struct CommittedToolResultSettlementResult {
    pub tx_digest: sui::types::Digest,
    pub tx_checkpoint: u64,
    pub dag_id: sui::types::Address,
    pub dag_execution_id: sui::types::Address,
    pub walk_index: u64,
}
```

#### `BrokenOnchainToolResultCleanup`

```rust
pub struct BrokenOnchainToolResultCleanup {
    pub walk_index: u64,
    pub result_ref: sui::types::ObjectReference,
    pub expected_vertex: RuntimeVertex,
    pub tool_witness_id: sui::types::Address,
}
```

#### `RecordCommittedToolResultGasChargeResult`

```rust
pub struct RecordCommittedToolResultGasChargeResult {
    pub tx_digest: sui::types::Digest,
    pub tx_checkpoint: u64,
    pub dag_execution_id: sui::types::Address,
    pub leader_cap_id: sui::types::Address,
    pub walk_index: u64,
}
```

#### `CommittedToolResultView`

```rust
pub struct CommittedToolResultView {
    pub expected_vertex: RuntimeVertex,
    pub primary_failure_evidence_kind: Option<FailureEvidenceKind>,
    pub secondary_failure_evidence_kind: Option<FailureEvidenceKind>,
    pub current_leader_cap_id: sui::types::Address,
    pub has_finalized_onchain_payload: bool,
    pub leader_records: Vec<CommittedToolResultLeaderRecordView>,
}
```

#### `CommittedToolResultView::leader_record`

```rust
pub fn leader_record(
        &self,
        leader_cap_id: sui::types::Address,
    ) -> Option<&CommittedToolResultLeaderRecordView> {
```

#### `CommittedToolResultLeaderRecordView`

```rust
pub struct CommittedToolResultLeaderRecordView {
    pub leader_cap_id: sui::types::Address,
    pub commit_tx_digest: Vec<u8>,
    pub recipient: sui::types::Address,
    pub commit_gas_charge: Option<u64>,
    pub settlement_gas_charge: Option<u64>,
}
```

#### `InsufficientSettlementMarkerView`

```rust
pub struct InsufficientSettlementMarkerView {
    pub walks: Vec<u64>,
}
```

#### `OnchainToolResultState`

```rust
pub enum OnchainToolResultState {
    NoResult,
    Finalized {
        result: OnchainToolResultInnerV1,
        object_ref: sui::types::ObjectReference,
    },
    Committed {
        committed_result: CommittedToolResultView,
    },
    InsufficientSettlement {
        committed_result: Option<CommittedToolResultView>,
        marker: InsufficientSettlementMarkerView,
    },
    InvalidEmpty {
        result_id: sui::types::Address,
        object_ref: sui::types::ObjectReference,
    },
}
```

#### `OnchainToolResultState::consume_ready_result`

```rust
pub fn consume_ready_result(
        &self,
    ) -> Option<(&OnchainToolResultInnerV1, &sui::types::ObjectReference)> {
```

#### `OnchainToolResultState::consume_object_input`

```rust
pub fn consume_object_input(&self) -> Option<talus_sui_move_call::CallArg> {
```

#### `InspectExecutionResult`

```rust
pub struct InspectExecutionResult {
    pub next_event: UnboundedReceiver<NexusEvent>,
    pub poller: JoinHandle<Result<(), NexusError>>,
}
```

#### `InspectExecutionOptions`

```rust
pub struct InspectExecutionOptions {
    pub timeout: Duration,
    pub poll_interval: Duration,
}
```

#### `WorkflowExecutionTerminalState`

```rust
pub enum WorkflowExecutionTerminalState {
    Succeeded,
    Failed,
    Aborted,
    NoWalkOutcome,
}
```

#### `ResolvedEndState`

```rust
pub struct ResolvedEndState {
    pub event: EndStateReachedEvent,
    pub resolved_ports_to_data: HashMap<String, NexusData>,
}
```

#### `InspectExecutionCompletionResult`

```rust
pub struct InspectExecutionCompletionResult {
    pub terminal_state: WorkflowExecutionTerminalState,
    pub execution_finished: ExecutionFinishedEvent,
    pub end_states: Vec<ResolvedEndState>,
    pub terminal_err_eval_recordings: Vec<TerminalErrEvalRecordedEvent>,
    pub events: Vec<NexusEvent>,
}
```

#### `ExecutionCostResult`

```rust
pub struct ExecutionCostResult {
    pub payment_id: sui::types::Address,
    pub max_budget_mist: u64,
    pub locked_budget_mist: u64,
    pub consumed: u64,
    pub outstanding_locks: u64,
    pub accomplished: bool,
    pub refunded: bool,
}
```

#### `WorkflowActions`

```rust
pub struct WorkflowActions {
    pub(super) client: NexusClient,
}
```

#### `dag_vertex_requires_tool_verification`

```rust
pub fn dag_vertex_requires_tool_verification(vertex: &graph_move::VertexInfo) -> bool {
```

#### `fetch_dag_vertices_bcs`

```rust
pub async fn fetch_dag_vertices_bcs(
    crawler: &Crawler,
    dag: &dag_move::DAGInnerV1,
) -> anyhow::Result<HashMap<graph_move::Vertex, graph_move::VertexInfo>> {
```

#### `fetch_dag_vertices_from_links_bcs`

```rust
pub async fn fetch_dag_vertices_from_links_bcs(
    crawler: &Crawler,
    context: &NexusContext,
    dag: &dag_move::DAGInnerV1,
) -> anyhow::Result<HashMap<graph_move::Vertex, graph_move::VertexInfo>> {
```

#### `fetch_dag_vertex_bcs`

```rust
pub async fn fetch_dag_vertex_bcs(
    crawler: &Crawler,
    context: &NexusContext,
    dag: &dag_move::DAGInnerV1,
    vertex: &graph_move::Vertex,
) -> anyhow::Result<Option<graph_move::VertexInfo>> {
```

#### `fetch_dag_vertices_by_keys_bcs`

```rust
pub async fn fetch_dag_vertices_by_keys_bcs<I>(
    crawler: &Crawler,
    context: &NexusContext,
    dag: &dag_move::DAGInnerV1,
    vertices: I,
) -> anyhow::Result<HashMap<graph_move::Vertex, graph_move::VertexInfo>>
where
    I: IntoIterator<Item = graph_move::Vertex>,
{
```

#### `fetch_committed_tool_result_for_walk`

```rust
pub async fn fetch_committed_tool_result_for_walk(
    crawler: &Crawler,
    context: &NexusContext,
    execution_id: sui::types::Address,
    walk_index: u64,
) -> anyhow::Result<Option<CommittedToolResultView>> {
```

#### `committed_tool_result_from_finalized_output`

```rust
pub fn committed_tool_result_from_finalized_output(
    crawler: &Crawler,
    context: &NexusContext,
    executed: &sui::grpc::ExecutedTransaction,
    transaction: sui::types::Digest,
    execution_id: sui::types::Address,
    walk_index: u64,
) -> anyhow::Result<Option<CommittedToolResultView>> {
```

#### `inspect_expired_walk_resolution`

```rust
pub async fn inspect_expired_walk_resolution(
    client: &NexusClient,
    params: ResolveExpiredWalkParams,
) -> anyhow::Result<ExpiredWalkResolutionPlan> {
```

#### `inspect_expired_walk_resolution_at`

```rust
pub async fn inspect_expired_walk_resolution_at(
    client: &NexusClient,
    params: ResolveExpiredWalkParams,
    clock_ms: u64,
) -> anyhow::Result<ExpiredWalkResolutionPlan> {
```

#### `fetch_onchain_tool_result_state_for_walk`

```rust
pub async fn fetch_onchain_tool_result_state_for_walk(
    client: &NexusClient,
    context: &NexusContext,
    execution_id: sui::types::Address,
    walk_index: u64,
) -> anyhow::Result<OnchainToolResultState> {
```

#### `fetch_dag_default_values_bcs`

```rust
pub async fn fetch_dag_default_values_bcs<T>(
    crawler: &Crawler,
    dag: &dag_move::DAGInnerV1,
) -> anyhow::Result<HashMap<graph_move::VertexInputPort, T>>
where
    T: serde::de::DeserializeOwned,
{
```

#### `fetch_dag_default_values_by_keys_bcs`

```rust
pub async fn fetch_dag_default_values_by_keys_bcs<T, I>(
    crawler: &Crawler,
    context: &NexusContext,
    dag: &dag_move::DAGInnerV1,
    ports: I,
) -> anyhow::Result<HashMap<graph_move::VertexInputPort, T>>
where
    T: serde::de::DeserializeOwned,
    I: IntoIterator<Item = graph_move::VertexInputPort>,
{
```

#### `fetch_dag_edges_bcs`

```rust
pub async fn fetch_dag_edges_bcs(
    crawler: &Crawler,
    dag: &dag_move::DAGInnerV1,
) -> anyhow::Result<HashMap<graph_move::Vertex, Vec<graph_move::Edge>>> {
```

#### `fetch_dag_outputs_bcs`

```rust
pub async fn fetch_dag_outputs_bcs(
    crawler: &Crawler,
    dag: &dag_move::DAGInnerV1,
) -> anyhow::Result<HashMap<graph_move::Vertex, Vec<graph_move::OutputVariantPort>>> {
```

#### `offchain_success_requires_tool_verification`

```rust
pub async fn offchain_success_requires_tool_verification(
    client: &NexusClient,
    context: &NexusContext,
    dag_object_id: sui::types::Address,
    next_vertex: &RuntimeVertex,
) -> anyhow::Result<bool> {
```

#### `fetch_vertex_input_port_names`

```rust
pub async fn fetch_vertex_input_port_names(
    crawler: &Crawler,
    context: &NexusContext,
    dag: &dag_move::DAGInnerV1,
    vertex_name: &TypeName,
) -> anyhow::Result<Vec<String>> {
```

#### `execution_terminal_record_matches_retryable_vertex`

```rust
pub fn execution_terminal_record_matches_retryable_vertex(
    terminal_records: &VecMap<u64, execution_move::TerminalErrEvalRecord>,
    walk_index: u64,
    next_vertex: &RuntimeVertex,
) -> bool {
```

#### `should_settle_tool_err_eval_gas`

```rust
pub async fn should_settle_tool_err_eval_gas(
    client: &NexusClient,
    execution: sui::types::Address,
    walk_index: u64,
    next_vertex: &RuntimeVertex,
) -> anyhow::Result<bool> {
```

#### `WorkflowActions::publish`

```rust
pub async fn publish(
        &self,
        workflow_package: sui::types::Address,
        dag_spec: DagSpec,
    ) -> Result<PublishResult, NexusError> {
```

#### `WorkflowActions::inspect_dag`

```rust
pub async fn inspect_dag(
        &self,
        dag_id: sui::types::Address,
    ) -> Result<DagSnapshot, NexusError> {
```

#### `WorkflowActions::authorize_invocation`

```rust
pub async fn authorize_invocation(
        &self,
        dag_execution_id: sui::types::Address,
        leader_cap_id: sui::types::Address,
        walk_index: u64,
        vertex: RuntimeVertex,
        policy: InvocationPolicy,
    ) -> Result<AuthorizeInvocationResult, NexusError> {
```

#### `WorkflowActions::inspect_execution`

```rust
pub async fn inspect_execution(
        &self,
        dag_execution_id: sui::types::Address,
        options: InspectExecutionOptions,
    ) -> Result<InspectExecutionResult, NexusError> {
```

#### `WorkflowActions::inspect_execution_until_completion`

```rust
pub async fn inspect_execution_until_completion(
        &self,
        dag_execution_id: sui::types::Address,
        options: InspectExecutionOptions,
        storage_conf: &StorageConf,
    ) -> Result<InspectExecutionCompletionResult, NexusError> {
```

#### `WorkflowActions::execution_cost`

```rust
pub async fn execution_cost(
        &self,
        dag_execution_id: sui::types::Address,
    ) -> Result<ExecutionCostResult, NexusError> {
```

#### `WorkflowActions::abort_expired_execution`

```rust
pub async fn abort_expired_execution(
        &self,
        dag_execution_id: sui::types::Address,
    ) -> Result<AbortExecutionResult, NexusError> {
```

#### `WorkflowActions::settle_committed_tool_result_for_walk`

```rust
pub async fn settle_committed_tool_result_for_walk(
        &self,
        params: SettleCommittedToolResultParams,
    ) -> Result<CommittedToolResultSettlementResult, NexusError> {
```

#### `WorkflowActions::settle_committed_tool_result_for_walk_by_leader`

```rust
pub async fn settle_committed_tool_result_for_walk_by_leader(
        &self,
        params: SettleCommittedToolResultByLeaderParams,
    ) -> Result<CommittedToolResultSettlementResult, NexusError> {
```

#### `WorkflowActions::record_committed_tool_result_gas_charge_by_leader`

```rust
pub async fn record_committed_tool_result_gas_charge_by_leader(
        &self,
        params: RecordCommittedToolResultGasChargeParams,
    ) -> Result<RecordCommittedToolResultGasChargeResult, NexusError> {
```

#### `WorkflowActions::inspect_expired_walk_resolution`

```rust
pub async fn inspect_expired_walk_resolution(
        &self,
        params: ResolveExpiredWalkParams,
    ) -> Result<ExpiredWalkResolutionPlan, NexusError> {
```

#### `WorkflowActions::resolve_expired_walk`

```rust
pub async fn resolve_expired_walk(
        &self,
        params: ResolveExpiredWalkParams,
    ) -> Result<ExpiredWalkResolutionResult, NexusError> {
```

#### `WorkflowActions::abort_expired_execution_invocation_candidates`

```rust
pub async fn abort_expired_execution_invocation_candidates(
        &self,
        dag_execution_id: sui::types::Address,
    ) -> Result<Vec<InvocationAbortCandidate>, NexusError> {
```

#### `WorkflowActions::abort_expired_execution_with_invocation`

```rust
pub async fn abort_expired_execution_with_invocation(
        &self,
        dag_execution_id: sui::types::Address,
        invocation_id: Option<sui::types::Address>,
    ) -> Result<AbortExpiredExecutionResult, NexusError> {
```

#### `payment_vertex_key`

```rust
pub fn payment_vertex_key(
    execution_id: sui::types::Address,
    vertex: &RuntimeVertex,
    tool_fqn: &crate::ToolFqn,
) -> anyhow::Result<Vec<u8>> {
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.talus.network/talus-docs-v2.1.0/reference/sdk/actions-workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
