Skip to content
Français

WorkflowCheckpointLease

import type { WorkflowCheckpointLease } from "@elie-laloum/outpost";
  • readRequired
    () => Promise<unknown>
    Returns the saved checkpoint as unvalidated data, or undefined for a new run. start() validates it against the workflow before running any task.
  • writeRequired
    (checkpoint: WorkflowCheckpoint) => Promise<void>
    Replaces the saved checkpoint while the lease is held. createWorkflowCheckpointStore() writes conditionally on the last revision, rejecting with TransportConflict once ownership is lost, and rejects checkpoints above 16 MiB.
  • releaseRequired
    () => Promise<void>
    Clears ownership once pending writes settle and keeps the saved checkpoint. start() calls it when it returns or rejects.
export interface WorkflowCheckpointLease {
  read(): Promise<unknown>;
  write(checkpoint: WorkflowCheckpoint): Promise<void>;
  release(): Promise<void>;
}