Anchorage API reference
    Preparing search index...
    Index

    Constructors

    Accessors

    • get pubsub(): PubSub | undefined

      The host pubsub identity this runtime was built with, or undefined when the host configured none. Exposed so callers can verify the identity and so an agent runner sharing this runtime's isolate takes THIS instance rather than building a second feed.

      Returns PubSub | undefined

    • get startIdempotency(): StartIdempotencyStore | undefined

      The deployment's start reservations, or undefined for a host with no database to reserve against. Exposed for the same reason the fence is: the surfaces ABOVE this runtime reserve and claim against it, and two stores over two bindings would be two different tables answering the same key.

      Returns StartIdempotencyStore | undefined

    Methods

    • status() for a caller about to CONCLUDE something irreversible from what it reads — delete a wake record, spend an abandonment budget, resume a run.

      Workflow.getInMemoryRunAsWorkflowState reports the retained Run's lifecycle status with isFromInMemory: true, without suspended paths or requestContext. Refusing that marker prevents an approximation from authorizing an irreversible action; after non-suspended completion the Run leaves the in-memory map, so the fallback is null.

      A valid v2 pending row is refused before lifecycle projection; it has no durable execution outcome yet.

      Parameters

      • workflowId: string
      • runId: string

      Returns Promise<RunSummary | null>

    • Marks idempotent terminal side-effect cleanup after every hook succeeds.

      Parameters

      • workflowId: string
      • runId: string
      • expectedRevision: number
      • now: number = ...

      Returns Promise<RunSummary>

    • Is this run EXECUTING in this isolate right now?

      The liveness half of the idempotent-start replay decision, answered from the same #activeRuns map the cancel path uses — the runtime's own record of runs it is currently driving. It is in-memory ON PURPOSE: liveness is a property of an isolate that is running code, and any durable proxy for it (a journal, a heartbeat, a timestamp) would keep saying "live" after the isolate that wrote it was evicted, which is precisely the case the probe exists to detect.

      A false here therefore means "not running HERE", which is authoritative only where the run has exactly one possible host — a run Durable Object addressed by idFromName(workflowId:runId), or the thread object an agent run is bound to. Callers that probe across an object boundary must ask the object that owns the run, never their own runtime.

      Parameters

      • workflowId: string
      • runId: string

      Returns boolean

    • Register an agent that a runtime-owned workflow resolves by id.

      Durable-agent workflows persist only the agent id. Keeping the raw agent on the same Mastra instance as the workflow lets a resumed run resolve it after isolate eviction, when the original DurableAgent instance is gone.

      Type Parameters

      • TAgentId extends string
      • TTools extends ToolsInput
      • TOutput

      Parameters

      Returns void

    • The PROJECTION read: the best answer available about a run, which is what an HTTP status route, a broadcast frame or an existence check wants.

      It can answer from Mastra's in-memory fallback, so a caller about to conclude something IRREVERSIBLE from what it reads — deleting wake state, spending an abandonment budget, resuming a run, deleting a row — must use RunnerRuntime.authoritativeStatus instead, which refuses a read that did not reach storage.

      Parameters

      • workflowId: string
      • runId: string

      Returns Promise<RunSummary | null>