@archastro/sdk
    Preparing search index...

    Class AgentWorkItemResource

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Claim or resume workflow work for an agent Atomically claims the oldest queued or lease-expired item. To resume after a harness restart, pass both the saved work_item and the same lease_owner; the server refreshes that active lease without incrementing its attempt. Returns data: null when no eligible item exists, including when another lease owns the explicitly requested item.

      Parameters

      • agent: string

        Agent ID or lookup key injected by the nested route.

      • input: {
            execution?: string;
            lease_owner: string;
            lease_seconds?: number;
            work_item?: string;
        }

        Request body.

        • Optionalexecution?: string

          Optional durable execution ID filter.

        • lease_owner: string

          Caller-generated random UUID lease token.

        • Optionallease_seconds?: number

          Lease duration from 15 through 3600 seconds. Defaults to 300.

        • Optionalwork_item?: string

          Saved work item ID to resume or reclaim.

      Returns Promise<WorkflowWorkItemClaim>

      Successful response

    • List active workflow work available to the viewer Lists queued, claimed, and running external work yielded by durable workflows. The top-level collection includes work for every agent the viewer can execute; the agent-nested collection limits results to that agent. This discovery response never includes lease tokens. Use the agent claim endpoint to acquire new work or resume a saved lease.

      Parameters

      • agent: string

        Agent ID or lookup key injected by the nested route.

      • Optionalparams: { afterCursor?: string; execution?: string; limit?: number }

        Query parameters.

        • OptionalafterCursor?: string

          Opaque cursor for the next page of older queued work.

        • Optionalexecution?: string

          Optional durable execution ID filter.

        • Optionallimit?: number

          Maximum work items per page. Defaults to 50; maximum is 100.

      Returns Promise<WorkflowWorkItemList>

      Successful response