# Function createCheckpoint

- createCheckpoint(
  opts: {
  executionId: string;
  stepNumber: number;
  state: Readonly<GraphState>;
  pendingNodeIds: readonly string[];
  completedResults: readonly NodeResult[];
  metadata?: Record<string, unknown>;
  interrupt?: CheckpointInterrupt;
  },
  ): Checkpoint

  Creates a checkpoint from the current execution state.

  #### Parameters

  - opts: {
    executionId: string;
    stepNumber: number;
    state: Readonly<GraphState>;
    pendingNodeIds: readonly string[];
    completedResults: readonly NodeResult[];
    metadata?: Record<string, unknown>;
    interrupt?: CheckpointInterrupt;
    }

    - ##### executionId: string

    - ##### stepNumber: number

    - ##### state: Readonly<GraphState>

    - ##### pendingNodeIds: readonly string[]

    - ##### completedResults: readonly NodeResult[]

    - ##### `Optional` metadata?: Record<string, unknown>

    - ##### `Optional` interrupt?: CheckpointInterrupt

      Set when persisting an interrupt-flavored checkpoint (#1895).

  #### Returns Checkpoint

  - Defined in packages/nexus-agents/src/orchestration/graph/checkpoint-store.ts:137