curl --request POST \
--url https://api.example.com/runs \
--header 'Content-Type: application/json' \
--data '
{
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {},
"command": {
"update": {},
"resume": {},
"goto": {
"node": "<string>",
"input": {}
}
},
"metadata": {},
"config": {
"tags": [
"<string>"
],
"recursion_limit": 123,
"configurable": {}
},
"context": {},
"webhook": "<string>",
"stream_mode": [
"values"
],
"feedback_keys": [
"<string>"
],
"stream_subgraphs": false,
"stream_resumable": false,
"on_completion": "delete",
"on_disconnect": "cancel",
"after_seconds": 123,
"checkpoint_during": false,
"durability": "async"
}
'import requests
url = "https://api.example.com/runs"
payload = {
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {},
"command": {
"update": {},
"resume": {},
"goto": {
"node": "<string>",
"input": {}
}
},
"metadata": {},
"config": {
"tags": ["<string>"],
"recursion_limit": 123,
"configurable": {}
},
"context": {},
"webhook": "<string>",
"stream_mode": ["values"],
"feedback_keys": ["<string>"],
"stream_subgraphs": False,
"stream_resumable": False,
"on_completion": "delete",
"on_disconnect": "cancel",
"after_seconds": 123,
"checkpoint_during": False,
"durability": "async"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
assistant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
input: {},
command: {update: {}, resume: {}, goto: {node: '<string>', input: {}}},
metadata: {},
config: {tags: ['<string>'], recursion_limit: 123, configurable: {}},
context: {},
webhook: '<string>',
stream_mode: ['values'],
feedback_keys: ['<string>'],
stream_subgraphs: false,
stream_resumable: false,
on_completion: 'delete',
on_disconnect: 'cancel',
after_seconds: 123,
checkpoint_during: false,
durability: 'async'
})
};
fetch('https://api.example.com/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'input' => [
],
'command' => [
'update' => [
],
'resume' => [
],
'goto' => [
'node' => '<string>',
'input' => [
]
]
],
'metadata' => [
],
'config' => [
'tags' => [
'<string>'
],
'recursion_limit' => 123,
'configurable' => [
]
],
'context' => [
],
'webhook' => '<string>',
'stream_mode' => [
'values'
],
'feedback_keys' => [
'<string>'
],
'stream_subgraphs' => false,
'stream_resumable' => false,
'on_completion' => 'delete',
'on_disconnect' => 'cancel',
'after_seconds' => 123,
'checkpoint_during' => false,
'durability' => 'async'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/runs"
payload := strings.NewReader("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"input\": {},\n \"command\": {\n \"update\": {},\n \"resume\": {},\n \"goto\": {\n \"node\": \"<string>\",\n \"input\": {}\n }\n },\n \"metadata\": {},\n \"config\": {\n \"tags\": [\n \"<string>\"\n ],\n \"recursion_limit\": 123,\n \"configurable\": {}\n },\n \"context\": {},\n \"webhook\": \"<string>\",\n \"stream_mode\": [\n \"values\"\n ],\n \"feedback_keys\": [\n \"<string>\"\n ],\n \"stream_subgraphs\": false,\n \"stream_resumable\": false,\n \"on_completion\": \"delete\",\n \"on_disconnect\": \"cancel\",\n \"after_seconds\": 123,\n \"checkpoint_during\": false,\n \"durability\": \"async\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/runs")
.header("Content-Type", "application/json")
.body("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"input\": {},\n \"command\": {\n \"update\": {},\n \"resume\": {},\n \"goto\": {\n \"node\": \"<string>\",\n \"input\": {}\n }\n },\n \"metadata\": {},\n \"config\": {\n \"tags\": [\n \"<string>\"\n ],\n \"recursion_limit\": 123,\n \"configurable\": {}\n },\n \"context\": {},\n \"webhook\": \"<string>\",\n \"stream_mode\": [\n \"values\"\n ],\n \"feedback_keys\": [\n \"<string>\"\n ],\n \"stream_subgraphs\": false,\n \"stream_resumable\": false,\n \"on_completion\": \"delete\",\n \"on_disconnect\": \"cancel\",\n \"after_seconds\": 123,\n \"checkpoint_during\": false,\n \"durability\": \"async\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"input\": {},\n \"command\": {\n \"update\": {},\n \"resume\": {},\n \"goto\": {\n \"node\": \"<string>\",\n \"input\": {}\n }\n },\n \"metadata\": {},\n \"config\": {\n \"tags\": [\n \"<string>\"\n ],\n \"recursion_limit\": 123,\n \"configurable\": {}\n },\n \"context\": {},\n \"webhook\": \"<string>\",\n \"stream_mode\": [\n \"values\"\n ],\n \"feedback_keys\": [\n \"<string>\"\n ],\n \"stream_subgraphs\": false,\n \"stream_resumable\": false,\n \"on_completion\": \"delete\",\n \"on_disconnect\": \"cancel\",\n \"after_seconds\": 123,\n \"checkpoint_during\": false,\n \"durability\": \"async\"\n}"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"Create Background Run
Create a run and return the run ID immediately. Don’t wait for the final run output.
curl --request POST \
--url https://api.example.com/runs \
--header 'Content-Type: application/json' \
--data '
{
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {},
"command": {
"update": {},
"resume": {},
"goto": {
"node": "<string>",
"input": {}
}
},
"metadata": {},
"config": {
"tags": [
"<string>"
],
"recursion_limit": 123,
"configurable": {}
},
"context": {},
"webhook": "<string>",
"stream_mode": [
"values"
],
"feedback_keys": [
"<string>"
],
"stream_subgraphs": false,
"stream_resumable": false,
"on_completion": "delete",
"on_disconnect": "cancel",
"after_seconds": 123,
"checkpoint_during": false,
"durability": "async"
}
'import requests
url = "https://api.example.com/runs"
payload = {
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {},
"command": {
"update": {},
"resume": {},
"goto": {
"node": "<string>",
"input": {}
}
},
"metadata": {},
"config": {
"tags": ["<string>"],
"recursion_limit": 123,
"configurable": {}
},
"context": {},
"webhook": "<string>",
"stream_mode": ["values"],
"feedback_keys": ["<string>"],
"stream_subgraphs": False,
"stream_resumable": False,
"on_completion": "delete",
"on_disconnect": "cancel",
"after_seconds": 123,
"checkpoint_during": False,
"durability": "async"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
assistant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
input: {},
command: {update: {}, resume: {}, goto: {node: '<string>', input: {}}},
metadata: {},
config: {tags: ['<string>'], recursion_limit: 123, configurable: {}},
context: {},
webhook: '<string>',
stream_mode: ['values'],
feedback_keys: ['<string>'],
stream_subgraphs: false,
stream_resumable: false,
on_completion: 'delete',
on_disconnect: 'cancel',
after_seconds: 123,
checkpoint_during: false,
durability: 'async'
})
};
fetch('https://api.example.com/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'input' => [
],
'command' => [
'update' => [
],
'resume' => [
],
'goto' => [
'node' => '<string>',
'input' => [
]
]
],
'metadata' => [
],
'config' => [
'tags' => [
'<string>'
],
'recursion_limit' => 123,
'configurable' => [
]
],
'context' => [
],
'webhook' => '<string>',
'stream_mode' => [
'values'
],
'feedback_keys' => [
'<string>'
],
'stream_subgraphs' => false,
'stream_resumable' => false,
'on_completion' => 'delete',
'on_disconnect' => 'cancel',
'after_seconds' => 123,
'checkpoint_during' => false,
'durability' => 'async'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/runs"
payload := strings.NewReader("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"input\": {},\n \"command\": {\n \"update\": {},\n \"resume\": {},\n \"goto\": {\n \"node\": \"<string>\",\n \"input\": {}\n }\n },\n \"metadata\": {},\n \"config\": {\n \"tags\": [\n \"<string>\"\n ],\n \"recursion_limit\": 123,\n \"configurable\": {}\n },\n \"context\": {},\n \"webhook\": \"<string>\",\n \"stream_mode\": [\n \"values\"\n ],\n \"feedback_keys\": [\n \"<string>\"\n ],\n \"stream_subgraphs\": false,\n \"stream_resumable\": false,\n \"on_completion\": \"delete\",\n \"on_disconnect\": \"cancel\",\n \"after_seconds\": 123,\n \"checkpoint_during\": false,\n \"durability\": \"async\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/runs")
.header("Content-Type", "application/json")
.body("{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"input\": {},\n \"command\": {\n \"update\": {},\n \"resume\": {},\n \"goto\": {\n \"node\": \"<string>\",\n \"input\": {}\n }\n },\n \"metadata\": {},\n \"config\": {\n \"tags\": [\n \"<string>\"\n ],\n \"recursion_limit\": 123,\n \"configurable\": {}\n },\n \"context\": {},\n \"webhook\": \"<string>\",\n \"stream_mode\": [\n \"values\"\n ],\n \"feedback_keys\": [\n \"<string>\"\n ],\n \"stream_subgraphs\": false,\n \"stream_resumable\": false,\n \"on_completion\": \"delete\",\n \"on_disconnect\": \"cancel\",\n \"after_seconds\": 123,\n \"checkpoint_during\": false,\n \"durability\": \"async\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"input\": {},\n \"command\": {\n \"update\": {},\n \"resume\": {},\n \"goto\": {\n \"node\": \"<string>\",\n \"input\": {}\n }\n },\n \"metadata\": {},\n \"config\": {\n \"tags\": [\n \"<string>\"\n ],\n \"recursion_limit\": 123,\n \"configurable\": {}\n },\n \"context\": {},\n \"webhook\": \"<string>\",\n \"stream_mode\": [\n \"values\"\n ],\n \"feedback_keys\": [\n \"<string>\"\n ],\n \"stream_subgraphs\": false,\n \"stream_resumable\": false,\n \"on_completion\": \"delete\",\n \"on_disconnect\": \"cancel\",\n \"after_seconds\": 123,\n \"checkpoint_during\": false,\n \"durability\": \"async\"\n}"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"Body
Payload for creating a run.
The assistant ID or graph name to run. If using graph name, will default to first assistant created from that graph.
The input to the graph.
The command to run.
Show child attributes
Show child attributes
Metadata to assign to the run.
The configuration for the assistant.
Show child attributes
Show child attributes
Static context added to the assistant.
Webhook to call after LangGraph API call is done.
1 - 65536The stream mode(s) to use.
values, messages, messages-tuple, tasks, checkpoints, updates, events, debug, custom Feedback keys to assign to run.
Whether to stream output from subgraphs.
Whether to persist the stream chunks in order to resume the stream later.
Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.
delete, keep The disconnect mode to use. Must be one of 'cancel' or 'continue'.
cancel, continue The number of seconds to wait before starting the run. Use to schedule future runs.
Whether to checkpoint during the run.
Durability level for the run. Must be one of 'sync', 'async', or 'exit'.
sync, async, exit Response
Success
Was this page helpful?