footprintjs - v11.2.0
    Preparing search index...

    Interface FlowchartCheckpoint

    Serializable checkpoint — everything needed to resume a paused flowchart, and nothing a resume never reads.

    LEAN (format 2): its size is the STATE's, never the run's length. The cursor is pausedStageId + subflowPath; the state is sharedState plus the captures of the subflows on that path (subflowStates). The run's history — the execution tree, the finished subflows' results, the commit log — is not here: read it from executor.getSnapshot() before resume() (format 1 carried executionTree and subflowResults; no resume read them).

    JSON-safe: no functions, no class instances, no SDK clients. Store anywhere: Redis, Postgres, localStorage, a file.

    const checkpoint = executor.getCheckpoint(); // after pause
    await redis.set(`session:${id}`, JSON.stringify(checkpoint));

    // Resume (hours later, possibly different server)
    const checkpoint = JSON.parse(await redis.get(`session:${id}`));
    const executor = new FlowChartExecutor(chart);
    await executor.resume(checkpoint, { approved: true });
    interface FlowchartCheckpoint {
        capture?: NativeCaptureObservation;
        checkpointVersion?: 2;
        executionCount?: number;
        idempotencyKey?: string;
        invokerStageId?: string;
        pausedAt: number;
        pauseData?: unknown;
        pausedBy?: "interrupt";
        pausedExecution?: PausedExecution;
        pausedStageId: string;
        pendingPauses?: readonly PendingPause[];
        redactionMarks?: RedactionMarks;
        sharedState: Record<string, unknown>;
        subflowPath: readonly string[];
        subflowStates: Record<string, Record<string, unknown>>;
        visitCounts?: Readonly<Record<string, number>>;
    }
    Index

    Paused root-leg observation only. No history/recorder data or storage acknowledgement is included.

    checkpointVersion?: 2

    The checkpoint FORMAT: 2, the lean checkpoint (1 from 9.39.0; absent before). resume() reads every older one through the one upcaster (pause/record.ts · upcastCheckpoint), which drops what later formats dropped — format 1's executionTree and subflowResults, the legacy continuationStageId — none of which a resume ever read. A version this release does not know is refused.

    executionCount?: number

    The shared execution counter at the moment of pause — the number of stages executed so far this run. Resume seeds it so post-resume runtimeStageIds (stageId#executionIndex) keep climbing and never collide with pre-pause ones, which is what the whole event-correlation model rests on.

    Optional for backward compatibility: a checkpoint persisted before this field existed (older Redis/Postgres rows) still validates and resumes with the previous (counter-restarting) behavior.

    idempotencyKey?: string

    The idempotency key the paused execution ran under (10.1) — present only when the paused stage touches an outside system with a key rule. resume() re-runs the stage (or runs its resumeFn) under THIS key, never a recomputed one: the input the rule read does not cross a resume, and a different key on the re-run would make the outside system apply the effect twice. A real value, like sharedState — no redaction policy touches the checkpoint. A malformed one is refused at resume().

    invokerStageId?: string

    Stage that invoked the paused child (decider, selector, fork). Absent for linear pauses.

    pausedAt: number

    Timestamp of when the pause occurred.

    pauseData?: unknown

    The pause payload (the pausable stage's return value or the interrupt() payload) — question, reason, metadata.

    pausedBy?: "interrupt"

    HOW the pause was raised. 'interrupt' means a stage body called interrupt(scope, { reason, expects? }) and pauseData IS that payload; absent means the addPausableFunction execute/resume path (every checkpoint written before 9.14.0 omits it, which is exactly right).

    resume() reads this to pick the re-entry, and the two differ by law: an interrupted stage RE-RUNS ITS OWN FUNCTION FROM THE TOP (stages are atomic — the answer comes back out of the interrupt() call), while a pausable stage runs its separate resumeFn.

    pausedExecution?: PausedExecution

    The paused EXECUTION (9.37.0): the run that paused and the paused stage's runtimeStageId in it (the id its onPause event and its commit carry). Read by resume() into the onResume event's traversalContext.resumedFrom link — never used to plan the re-entry. Absent on an older checkpoint, which then resumes without a link.

    pausedStageId: string

    ID of the stage that paused. Used by resume() to find the node in the graph.

    pendingPauses?: readonly PendingPause[]

    Pauses raised by PARALLEL SIBLINGS of the paused stage in the same fan-out, waiting their turn (9.28.0) — see PendingPause. Absent when only one child paused (every checkpoint before 9.28.0 omits it, and resumes exactly as before). Resuming this checkpoint finishes the paused stage's child, then pauses again with the first of these; the fan-out's join runs once every child is done.

    redactionMarks?: RedactionMarks

    The redaction marks of the paused run — NAMES only (see RedactionMarks). Absent when the run marked nothing (no policy and no per-call mark, or an older checkpoint): the resumed run then starts from its policy alone.

    sharedState: Record<string, unknown>

    Scope state at the pause point — all shared memory key/values.

    subflowPath: readonly string[]

    Path through subflows to the paused stage (e.g., ['sf-payment', 'sf-validation']). Empty array when paused at the top level.

    subflowStates: Record<string, Record<string, unknown>>

    Subflow scope capture — one entry per subflow boundary on the path to the paused stage. Keyed by path-prefixed subflow id (matches subflowPath entries). Each value is the subflow's pre-pause shared state.

    Always present (empty {} for root-level pauses where no subflows were entered). On resume, SubflowExecutor seeds each nested runtime on the path from this map — ONCE, on its first entry, in place of the inputMapper's values (the mapper still runs, for the stages' read-only args) — so resume handlers see pre-pause scope across same-executor AND cross-executor restarts. Only the subflows ON subflowPath read it.

    visitCounts?: Readonly<Record<string, number>>

    Per-stageId loop visit counts at the moment of pause. Resume seeds them so TraversalContext.loopIteration stays continuous across the pause (a mid-loop resume keeps counting up, not restarting at 0) and the ContinuationResolver iteration budget is not silently refilled.

    Optional for the same backward-compatibility reason as executionCount.