@threadplane/langgraphInterfacev0.3.4

SubmitOptions

LangGraph SDK run-submission options, including configuration, context, checkpoint, commands, streaming, and optimistic state.

import type { SubmitOptions } from '@threadplane/langgraph';

Declaration

interface SubmitOptions<StateType extends Record<string, unknown> = Record<string, unknown>, ContextType extends Record<string, unknown> = Record<string, unknown>>  {
  checkpoint?: Omit<Checkpoint, "thread_id"> | null;
  command?: Command;
  config?: ConfigWithConfigurable<ContextType>;
  context?: ContextType;
  durability?: Durability;
  feedbackKeys?: string[];
  interruptAfter?: "*" | string[];
  interruptBefore?: "*" | string[];
  metadata?: Metadata;
  multitaskStrategy?: MultitaskStrategy;
  onCompletion?: OnCompletionBehavior;
  onDisconnect?: DisconnectMode;
  onError?: (error: unknown, run: RunCallbackMeta | undefined) => void;
  optimisticValues?: Partial<StateType> | ((prev: StateType) => Partial<StateType>);
  runId?: string;
  streamMode?: Array<StreamMode>;
  streamResumable?: boolean;
  streamSubgraphs?: boolean;
  threadId?: string;
}

Type parameters

StateType
Record<string, unknown> Default: Record<string, unknown>
ContextType
Record<string, unknown> Default: Record<string, unknown>

Members

checkpoint

checkpoint?: Omit<Checkpoint, "thread_id"> | null;

command

command?: Command;

config

config?: ConfigWithConfigurable<ContextType>;

context

context?: ContextType;

durability

Whether to checkpoint during the run (or only at the end/interruption).

  • "async": Save checkpoint asynchronously while the next step executes (default).
  • "sync": Save checkpoint synchronously before the next step starts.
  • "exit": Save checkpoint only when the graph exits. @default "async"
durability?: Durability;

feedbackKeys

feedbackKeys?: string[];

interruptAfter

interruptAfter?: "*" | string[];

interruptBefore

interruptBefore?: "*" | string[];

metadata

metadata?: Metadata;

multitaskStrategy

multitaskStrategy?: MultitaskStrategy;

onCompletion

onCompletion?: OnCompletionBehavior;

onDisconnect

onDisconnect?: DisconnectMode;

onError

Callback that is called when an error occurs during this specific submit call. Unlike the hook-level onError, this allows handling errors on a per-submit basis, e.g. to show a retry button or a specific error message to the user.

onError?: (error: unknown, run: RunCallbackMeta | undefined) => void;

optimisticValues

optimisticValues?: Partial<StateType> | ((prev: StateType) => Partial<StateType>);

runId

runId?: string;

streamMode

streamMode?: Array<StreamMode>;

streamResumable

Mark the stream as resumable. All events emitted during the run will be temporarily persisted in order to be re-emitted if the stream is re-joined. @default false

streamResumable?: boolean;

streamSubgraphs

Whether or not to stream the nodes of any subgraphs called by the assistant. @default false

streamSubgraphs?: boolean;

threadId

The ID to use when creating a new thread. When provided, this ID will be used for thread creation when threadId is null or undefined. This enables optimistic UI updates where you know the thread ID before the thread is actually created.

threadId?: string;