๐ŸŒ Global Mirror โ€” Visit original CN site โ†’
Skip to main content
POST
/
threads
/
{thread_id}
/
runs
Create Background Run
curl --request POST \
  --url https://api.example.com/threads/{thread_id}/runs \
  --header 'Content-Type: application/json' \
  --data '
{
  "assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "checkpoint": {
    "thread_id": "<string>",
    "checkpoint_ns": "<string>",
    "checkpoint_id": "<string>",
    "checkpoint_map": {}
  },
  "input": {},
  "command": {
    "update": {},
    "resume": {},
    "goto": {
      "node": "<string>",
      "input": {}
    }
  },
  "metadata": {},
  "config": {
    "tags": [
      "<string>"
    ],
    "recursion_limit": 123,
    "configurable": {}
  },
  "context": {},
  "webhook": "<string>",
  "interrupt_before": "*",
  "interrupt_after": "*",
  "stream_mode": [
    "values"
  ],
  "stream_subgraphs": false,
  "stream_resumable": false,
  "on_disconnect": "continue",
  "feedback_keys": [
    "<string>"
  ],
  "multitask_strategy": "enqueue",
  "if_not_exists": "reject",
  "after_seconds": 123,
  "checkpoint_during": false,
  "durability": "async"
}
'
{
  "run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "status": "pending",
  "metadata": {},
  "kwargs": {},
  "multitask_strategy": "reject"
}

Path Parameters

thread_id
string<uuid>
required

The ID of the thread.

Body

application/json

Payload for creating a run.

assistant_id
required

The assistant ID or graph name to run. If using graph name, will default to first assistant created from that graph.

checkpoint
Checkpoint ยท object

The checkpoint to resume from.

input

The input to the graph.

command
Command ยท object

The command to run.

metadata
Metadata ยท object

Metadata to assign to the run.

config
Config ยท object

The configuration for the assistant.

context
Context ยท object

Static context added to the assistant.

webhook
string<uri-reference>

Webhook to call after LangGraph API call is done.

Required string length: 1 - 65536
interrupt_before

Nodes to interrupt immediately before they get executed.

Available options:
*
interrupt_after

Nodes to interrupt immediately after they get executed.

Available options:
*
stream_mode

The stream mode(s) to use.

Available options:
values,
messages,
messages-tuple,
tasks,
checkpoints,
updates,
events,
debug,
custom
stream_subgraphs
boolean
default:false

Whether to stream output from subgraphs.

stream_resumable
boolean
default:false

Whether to persist the stream chunks in order to resume the stream later.

on_disconnect
enum<string>
default:continue

The disconnect mode to use. Must be one of 'cancel' or 'continue'.

Available options:
cancel,
continue
feedback_keys
string[]

Generate pre-signed URLs for assigning feedback keys to the run.

For each key specified, a unique URL will be generated that can be called to assign the feedback key to the run. See LangSmith Feedback for more details.

multitask_strategy
enum<string>
default:enqueue

Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.

Available options:
reject,
rollback,
interrupt,
enqueue
if_not_exists
enum<string>
default:reject

How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).

Available options:
create,
reject
after_seconds
number

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

checkpoint_during
boolean
default:false
deprecated

Whether to checkpoint during the run.

Deprecated. Use durability instead to control checkpoint persistence behavior during the run.

durability
enum<string>
default:async

Durability level for the run. Must be one of sync, async, or exit. See durability modes for more details.

Available options:
sync,
async,
exit

Response

Success

run_id
string<uuid>
required

The ID of the run.

thread_id
string<uuid>
required

The ID of the thread.

assistant_id
string<uuid>
required

The assistant that was used for this run.

created_at
string<date-time>
required

The time the run was created.

updated_at
string<date-time>
required

The last time the run was updated.

status
enum<string>
required

The status of the run. One of 'pending', 'running', 'error', 'success', 'timeout', 'interrupted'.

Available options:
pending,
running,
error,
success,
timeout,
interrupted
metadata
Metadata ยท object
required

The run metadata.

kwargs
Kwargs ยท object
required
multitask_strategy
enum<string>
required

Strategy to handle concurrent runs on the same thread.

Available options:
reject,
rollback,
interrupt,
enqueue