Create Schedule
curl --request POST \
--url https://api.example.com/agents/{agent_id}/schedules \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow_name": "<string>",
"task_queue": "<string>",
"workflow_params": {},
"cron_expression": "<string>",
"interval_seconds": 2,
"execution_timeout_seconds": 2,
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": false
}
'import requests
url = "https://api.example.com/agents/{agent_id}/schedules"
payload = {
"name": "<string>",
"workflow_name": "<string>",
"task_queue": "<string>",
"workflow_params": {},
"cron_expression": "<string>",
"interval_seconds": 2,
"execution_timeout_seconds": 2,
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": False
}
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({
name: '<string>',
workflow_name: '<string>',
task_queue: '<string>',
workflow_params: {},
cron_expression: '<string>',
interval_seconds: 2,
execution_timeout_seconds: 2,
start_at: '2023-11-07T05:31:56Z',
end_at: '2023-11-07T05:31:56Z',
paused: false
})
};
fetch('https://api.example.com/agents/{agent_id}/schedules', 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/agents/{agent_id}/schedules",
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([
'name' => '<string>',
'workflow_name' => '<string>',
'task_queue' => '<string>',
'workflow_params' => [
],
'cron_expression' => '<string>',
'interval_seconds' => 2,
'execution_timeout_seconds' => 2,
'start_at' => '2023-11-07T05:31:56Z',
'end_at' => '2023-11-07T05:31:56Z',
'paused' => false
]),
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/agents/{agent_id}/schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workflow_name\": \"<string>\",\n \"task_queue\": \"<string>\",\n \"workflow_params\": {},\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"execution_timeout_seconds\": 2,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false\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/agents/{agent_id}/schedules")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workflow_name\": \"<string>\",\n \"task_queue\": \"<string>\",\n \"workflow_params\": {},\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"execution_timeout_seconds\": 2,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/{agent_id}/schedules")
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 \"name\": \"<string>\",\n \"workflow_name\": \"<string>\",\n \"task_queue\": \"<string>\",\n \"workflow_params\": {},\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"execution_timeout_seconds\": 2,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false\n}"
response = http.request(request)
puts response.read_body{
"schedule_id": "<string>",
"name": "<string>",
"agent_id": "<string>",
"state": "ACTIVE",
"action": {
"workflow_name": "<string>",
"workflow_id_prefix": "<string>",
"task_queue": "<string>",
"workflow_params": [
"<unknown>"
]
},
"spec": {
"cron_expressions": [
"<string>"
],
"intervals_seconds": [
123
],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
},
"num_actions_taken": 0,
"num_actions_missed": 0,
"next_action_times": [
"2023-11-07T05:31:56Z"
],
"last_action_time": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Schedules
Create Schedule
Create a new schedule for recurring workflow execution for an agent.
POST
/
agents
/
{agent_id}
/
schedules
Create Schedule
curl --request POST \
--url https://api.example.com/agents/{agent_id}/schedules \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow_name": "<string>",
"task_queue": "<string>",
"workflow_params": {},
"cron_expression": "<string>",
"interval_seconds": 2,
"execution_timeout_seconds": 2,
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": false
}
'import requests
url = "https://api.example.com/agents/{agent_id}/schedules"
payload = {
"name": "<string>",
"workflow_name": "<string>",
"task_queue": "<string>",
"workflow_params": {},
"cron_expression": "<string>",
"interval_seconds": 2,
"execution_timeout_seconds": 2,
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": False
}
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({
name: '<string>',
workflow_name: '<string>',
task_queue: '<string>',
workflow_params: {},
cron_expression: '<string>',
interval_seconds: 2,
execution_timeout_seconds: 2,
start_at: '2023-11-07T05:31:56Z',
end_at: '2023-11-07T05:31:56Z',
paused: false
})
};
fetch('https://api.example.com/agents/{agent_id}/schedules', 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/agents/{agent_id}/schedules",
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([
'name' => '<string>',
'workflow_name' => '<string>',
'task_queue' => '<string>',
'workflow_params' => [
],
'cron_expression' => '<string>',
'interval_seconds' => 2,
'execution_timeout_seconds' => 2,
'start_at' => '2023-11-07T05:31:56Z',
'end_at' => '2023-11-07T05:31:56Z',
'paused' => false
]),
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/agents/{agent_id}/schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workflow_name\": \"<string>\",\n \"task_queue\": \"<string>\",\n \"workflow_params\": {},\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"execution_timeout_seconds\": 2,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false\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/agents/{agent_id}/schedules")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workflow_name\": \"<string>\",\n \"task_queue\": \"<string>\",\n \"workflow_params\": {},\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"execution_timeout_seconds\": 2,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/{agent_id}/schedules")
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 \"name\": \"<string>\",\n \"workflow_name\": \"<string>\",\n \"task_queue\": \"<string>\",\n \"workflow_params\": {},\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"execution_timeout_seconds\": 2,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false\n}"
response = http.request(request)
puts response.read_body{
"schedule_id": "<string>",
"name": "<string>",
"agent_id": "<string>",
"state": "ACTIVE",
"action": {
"workflow_name": "<string>",
"workflow_id_prefix": "<string>",
"task_queue": "<string>",
"workflow_params": [
"<unknown>"
]
},
"spec": {
"cron_expressions": [
"<string>"
],
"intervals_seconds": [
123
],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
},
"num_actions_taken": 0,
"num_actions_missed": 0,
"next_action_times": [
"2023-11-07T05:31:56Z"
],
"last_action_time": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
Request model for creating a new schedule for an agent
Response
Successful Response
Response model for schedule operations

