Skip to content
Français

createWorkflowCheckpointStore

import { createWorkflowCheckpointStore } from "@elie-laloum/outpost";

Create a WorkflowCheckpointStore that keeps each run’s checkpoint and owner in one object, checkpoints/<SHA-256 of runId>.json. acquire() rejects while an owner is recorded, and release keeps the saved progress. Ownership never expires: after a crash, stop the old runner and call recoverWorkflowCheckpoint().

Complete example and detailed rules.

  • optionsRequired
    TransportStoreOptions
    Transport that holds one object per run under checkpoints/, with its checkpoint and owner.
  • options.transporterRequired
    Transport
    Caller-owned object transport used by the store or operation. Closing a workflow or sandbox does not close this transport.

WorkflowCheckpointStore

export declare function createWorkflowCheckpointStore(
  options: TransportStoreOptions,
): WorkflowCheckpointStore;