Interface RunsInvokePayload

interface RunsInvokePayload {
    afterSeconds?: number;
    checkpoint?: Omit<Checkpoint, "thread_id">;
    checkpointDuring?: boolean;
    checkpointId?: string;
    command?: Command;
    config?: Config;
    ifNotExists?: "reject" | "create";
    input?: null | Record<string, unknown>;
    interruptAfter?: string[] | "*";
    interruptBefore?: string[] | "*";
    metadata?: Metadata;
    multitaskStrategy?: MultitaskStrategy;
    onCompletion?: OnCompletionBehavior;
    onDisconnect?: DisconnectMode;
    onRunCreated?: ((params) => void);
    signal?: AbortSignal;
    webhook?: string;
}

Properties

afterSeconds?: number

The number of seconds to wait before starting the run. Use to schedule future runs.

checkpoint?: Omit<Checkpoint, "thread_id">

Checkpoint for when creating a new run.

checkpointDuring?: boolean

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

checkpointId?: string

Checkpoint ID for when creating a new run.

command?: Command

One or more commands to invoke the graph with.

config?: Config

Additional configuration for the run.

ifNotExists?: "reject" | "create"

Behavior if the specified run doesn't exist. Defaults to "reject".

input?: null | Record<string, unknown>

Input to the run. Pass null to resume from the current state of the thread.

interruptAfter?: string[] | "*"

Interrupt execution after leaving these nodes.

interruptBefore?: string[] | "*"

Interrupt execution before entering these nodes.

metadata?: Metadata

Metadata for the run.

multitaskStrategy?: MultitaskStrategy

Strategy to handle concurrent runs on the same thread. Only relevant if there is a pending/inflight run on the same thread. One of:

  • "reject": Reject the new run.
  • "interrupt": Interrupt the current run, keeping steps completed until now, and start a new one.
  • "rollback": Cancel and delete the existing run, rolling back the thread to the state before it had started, then start the new run.
  • "enqueue": Queue up the new run to start after the current run finishes.
onCompletion?: OnCompletionBehavior

Behavior to handle run completion. Only relevant if there is a pending/inflight run on the same thread. One of:

  • "complete": Complete the run.
  • "continue": Continue the run.
onDisconnect?: DisconnectMode

Behavior to handle disconnection. Only relevant if there is a pending/inflight run on the same thread. One of:

  • "cancel": Cancel the run.
  • "continue": Continue the run.
onRunCreated?: ((params) => void)

Callback when a run is created.

Type declaration

    • (params): void
    • Parameters

      • params: {
            run_id: string;
            thread_id?: string;
        }
        • run_id: string
        • Optional thread_id?: string

      Returns void

signal?: AbortSignal

Abort controller signal to cancel the run.

webhook?: string

Webhook to call when the run is complete.