Skip to content
Français

RunSnapshot

import type { RunSnapshot } from "@elie-laloum/outpost/observation";
  • versionRequired
    1
    Stored projection schema version, currently 1.
  • idRequired
    string
    Application-selected lookup ID; independent of the workflow execution identity.
  • kindRequired
    "workflow" | "dispatch"
    One standalone dispatch or one workflow containing task dispatches.
  • executionIdOptional
    string | undefined
    Workflow execution identity learned from its start event and fenced across resumes.
  • workflowOptional
    string | undefined
    Declared workflow name from its lifecycle events.
  • statusRequired
    RunStatus
    Observed lifecycle; an expired running heartbeat is returned as suspected abandoned.
  • seqRequired
    number
    Last published persistent event cursor; watchRun starts strictly after it.
  • observationSeqRequired
    number
    Last delivered hub sequence, reset with a fresh hub on settled workflow resume.
  • completeRequired
    boolean
    False for a detected hub sequence gap or heartbeat expiry. True does not prove that no trailing events were lost.
  • startedAtRequired
    string
    Receiver creation time for the first projection, preserved on resume.
  • updatedAtRequired
    string
    Time of the latest published observation; heartbeat-only updates leave it unchanged.
  • heartbeatAtRequired
    string
    Last successful heartbeat publication time, using the writer clock.
  • expiresAtRequired
    string
    Heartbeat expiry time; readers derive abandoned only for running snapshots.
  • tasksRequired
    readonly RunTask[]
    Declared task states populated at workflow start and refreshed at finish or resume.
  • dispatchesRequired
    readonly RunDispatch[]
    Observed dispatch history grouped by identity, task and attempt.
  • commitsRequired
    readonly Commit[]
    Observed dispatch commits deduplicated by object ID.
  • usageRequired
    Usage
    Authoritative cumulative workflow tokens or standalone dispatch tokens; nested reports are not added twice.
  • accountingOptional
    WorkflowUsage | undefined
    Workflow budget snapshot with cumulative attempts, tokens and optional monetary estimate.
  • errorsRequired
    readonly RunError[]
    Observed task, workflow and classified dispatch failure messages.
export interface RunSnapshot {
  readonly version: 1;
  readonly id: string;
  readonly kind: "dispatch" | "workflow";
  readonly executionId?: string;
  readonly workflow?: string;
  readonly status: RunStatus;
  readonly seq: number;
  readonly observationSeq: number;
  readonly complete: boolean;
  readonly startedAt: string;
  readonly updatedAt: string;
  readonly heartbeatAt: string;
  readonly expiresAt: string;
  readonly tasks: readonly RunTask[];
  readonly dispatches: readonly RunDispatch[];
  readonly commits: readonly Commit[];
  readonly usage: Usage;
  readonly accounting?: WorkflowUsage;
  readonly errors: readonly RunError[];
}