Anchorage API reference
    Preparing search index...

    Additive run-lifecycle operations returned by createDoRunTopology.

    interface DoRunLifecycleTopology {
        dispatchStatus(
            workflowId: string,
            runId: string,
        ): Promise<RunSummary | undefined>;
        resume(
            workflowId: string,
            runId: string,
            body: unknown,
            requestedBy: string,
            requestedByKind: "human" | "service" | "agent" | "system",
        ): Promise<RunSummary>;
        resumeRecord(
            record: ApprovalRecord,
            decision: ApprovalDecision,
        ): Promise<RunSummary>;
        start(input: DoRunStartInput): Promise<RunSummary>;
        startLiveness(workflowId: string, runId: string): Promise<boolean>;
        status(workflowId: string, runId: string): Promise<RunSummary | undefined>;
        terminate(
            workflowId: string,
            runId: string,
            principal: ExecutionPrincipal,
            replayOnly?: boolean,
        ): Promise<RunSummary>;
        timeOut(
            workflowId: string,
            runId: string,
            cas: RunLifecycleCas,
            principal: ExecutionPrincipal,
        ): Promise<RunSummary>;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • createRunRouter's resume thunk.

      Parameters

      • workflowId: string
      • runId: string
      • body: unknown
      • requestedBy: string
      • requestedByKind: "human" | "service" | "agent" | "system"

      Returns Promise<RunSummary>

    • Is a start for this run executing in its Durable Object right now?

      createRunRouter's liveness probe, and the reason an idempotent replay can tell "still working" from "died holding the claim" without a timer. The run object is the only place that can answer: it is addressed by idFromName(workflowId:runId), so there is exactly one instance that could be running this run, and if that instance says no then nothing is.

      An unreachable object reads as NOT live. That is the fail-closed direction here — it produces the refusal that asks a human to investigate, whereas a default of "live" would answer a permanently broken run with a permanently retryable 503.

      Parameters

      • workflowId: string
      • runId: string

      Returns Promise<boolean>