curl --request POST \
--url https://odyssey.asteroid.ai/agents/v2/execution-batches \
--header 'Content-Type: application/json' \
--header 'X-Asteroid-Agents-Api-Key: <api-key>' \
--data '
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"batchInterval": 123,
"batchSize": 123,
"type": "timeBatching"
},
"items": [
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfilePoolId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"executionOptions": {
"softTimeoutMins": 2,
"variantKey": "<string>"
},
"inputVars": {},
"metadata": {}
}
],
"name": "<string>",
"startAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://odyssey.asteroid.ai/agents/v2/execution-batches"
payload = {
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"batchInterval": 123,
"batchSize": 123,
"type": "timeBatching"
},
"items": [
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfilePoolId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"executionOptions": {
"softTimeoutMins": 2,
"variantKey": "<string>"
},
"inputVars": {},
"metadata": {}
}
],
"name": "<string>",
"startAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-Asteroid-Agents-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Asteroid-Agents-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
config: {batchInterval: 123, batchSize: 123, type: 'timeBatching'},
items: [
{
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agentProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agentProfilePoolId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
executionOptions: {softTimeoutMins: 2, variantKey: '<string>'},
inputVars: {},
metadata: {}
}
],
name: '<string>',
startAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://odyssey.asteroid.ai/agents/v2/execution-batches', 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://odyssey.asteroid.ai/agents/v2/execution-batches",
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([
'agentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'config' => [
'batchInterval' => 123,
'batchSize' => 123,
'type' => 'timeBatching'
],
'items' => [
[
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agentProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agentProfilePoolId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'executionOptions' => [
'softTimeoutMins' => 2,
'variantKey' => '<string>'
],
'inputVars' => [
],
'metadata' => [
]
]
],
'name' => '<string>',
'startAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Asteroid-Agents-Api-Key: <api-key>"
],
]);
$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://odyssey.asteroid.ai/agents/v2/execution-batches"
payload := strings.NewReader("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {\n \"batchInterval\": 123,\n \"batchSize\": 123,\n \"type\": \"timeBatching\"\n },\n \"items\": [\n {\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfilePoolId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"executionOptions\": {\n \"softTimeoutMins\": 2,\n \"variantKey\": \"<string>\"\n },\n \"inputVars\": {},\n \"metadata\": {}\n }\n ],\n \"name\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Asteroid-Agents-Api-Key", "<api-key>")
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://odyssey.asteroid.ai/agents/v2/execution-batches")
.header("X-Asteroid-Agents-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {\n \"batchInterval\": 123,\n \"batchSize\": 123,\n \"type\": \"timeBatching\"\n },\n \"items\": [\n {\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfilePoolId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"executionOptions\": {\n \"softTimeoutMins\": 2,\n \"variantKey\": \"<string>\"\n },\n \"inputVars\": {},\n \"metadata\": {}\n }\n ],\n \"name\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/agents/v2/execution-batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Asteroid-Agents-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {\n \"batchInterval\": 123,\n \"batchSize\": 123,\n \"type\": \"timeBatching\"\n },\n \"items\": [\n {\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfilePoolId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"executionOptions\": {\n \"softTimeoutMins\": 2,\n \"variantKey\": \"<string>\"\n },\n \"inputVars\": {},\n \"metadata\": {}\n }\n ],\n \"name\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"awaitingCapacityCount": 123,
"cancelledCount": 123,
"concurrencyGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"batchInterval": 123,
"batchSize": 123,
"type": "timeBatching"
},
"createdAt": "2023-11-07T05:31:56Z",
"failedCount": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"pendingCount": 123,
"startAt": "2023-11-07T05:31:56Z",
"totalCount": 123,
"triggeredCount": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "<string>"
}{
"code": 401,
"message": "<string>"
}{
"code": 403,
"message": "<string>"
}{
"code": 404,
"message": "<string>"
}{
"code": 500,
"message": "<string>"
}Create execution batch
Create a new execution batch with items and configuration
curl --request POST \
--url https://odyssey.asteroid.ai/agents/v2/execution-batches \
--header 'Content-Type: application/json' \
--header 'X-Asteroid-Agents-Api-Key: <api-key>' \
--data '
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"batchInterval": 123,
"batchSize": 123,
"type": "timeBatching"
},
"items": [
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfilePoolId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"executionOptions": {
"softTimeoutMins": 2,
"variantKey": "<string>"
},
"inputVars": {},
"metadata": {}
}
],
"name": "<string>",
"startAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://odyssey.asteroid.ai/agents/v2/execution-batches"
payload = {
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"batchInterval": 123,
"batchSize": 123,
"type": "timeBatching"
},
"items": [
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentProfilePoolId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"executionOptions": {
"softTimeoutMins": 2,
"variantKey": "<string>"
},
"inputVars": {},
"metadata": {}
}
],
"name": "<string>",
"startAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-Asteroid-Agents-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Asteroid-Agents-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
config: {batchInterval: 123, batchSize: 123, type: 'timeBatching'},
items: [
{
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agentProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agentProfilePoolId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
executionOptions: {softTimeoutMins: 2, variantKey: '<string>'},
inputVars: {},
metadata: {}
}
],
name: '<string>',
startAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://odyssey.asteroid.ai/agents/v2/execution-batches', 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://odyssey.asteroid.ai/agents/v2/execution-batches",
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([
'agentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'config' => [
'batchInterval' => 123,
'batchSize' => 123,
'type' => 'timeBatching'
],
'items' => [
[
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agentProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agentProfilePoolId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'executionOptions' => [
'softTimeoutMins' => 2,
'variantKey' => '<string>'
],
'inputVars' => [
],
'metadata' => [
]
]
],
'name' => '<string>',
'startAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Asteroid-Agents-Api-Key: <api-key>"
],
]);
$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://odyssey.asteroid.ai/agents/v2/execution-batches"
payload := strings.NewReader("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {\n \"batchInterval\": 123,\n \"batchSize\": 123,\n \"type\": \"timeBatching\"\n },\n \"items\": [\n {\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfilePoolId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"executionOptions\": {\n \"softTimeoutMins\": 2,\n \"variantKey\": \"<string>\"\n },\n \"inputVars\": {},\n \"metadata\": {}\n }\n ],\n \"name\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Asteroid-Agents-Api-Key", "<api-key>")
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://odyssey.asteroid.ai/agents/v2/execution-batches")
.header("X-Asteroid-Agents-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {\n \"batchInterval\": 123,\n \"batchSize\": 123,\n \"type\": \"timeBatching\"\n },\n \"items\": [\n {\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfilePoolId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"executionOptions\": {\n \"softTimeoutMins\": 2,\n \"variantKey\": \"<string>\"\n },\n \"inputVars\": {},\n \"metadata\": {}\n }\n ],\n \"name\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/agents/v2/execution-batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Asteroid-Agents-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"config\": {\n \"batchInterval\": 123,\n \"batchSize\": 123,\n \"type\": \"timeBatching\"\n },\n \"items\": [\n {\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentProfilePoolId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"executionOptions\": {\n \"softTimeoutMins\": 2,\n \"variantKey\": \"<string>\"\n },\n \"inputVars\": {},\n \"metadata\": {}\n }\n ],\n \"name\": \"<string>\",\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"awaitingCapacityCount": 123,
"cancelledCount": 123,
"concurrencyGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"batchInterval": 123,
"batchSize": 123,
"type": "timeBatching"
},
"createdAt": "2023-11-07T05:31:56Z",
"failedCount": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"pendingCount": 123,
"startAt": "2023-11-07T05:31:56Z",
"totalCount": 123,
"triggeredCount": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "<string>"
}{
"code": 401,
"message": "<string>"
}{
"code": 403,
"message": "<string>"
}{
"code": 404,
"message": "<string>"
}{
"code": 500,
"message": "<string>"
}Authorizations
Body
Request to create a new execution batch
Agent ID for this batch
Batch configuration
- Option 1
- Option 2
Show child attributes
Show child attributes
Items to execute in this batch
Show child attributes
Show child attributes
Human-readable name for the batch
When to start triggering executions
Response
The request has succeeded and a new resource has been created as a result.
Execution batch with status counts
Agent ID this batch belongs to
Number of items awaiting capacity
Number of cancelled items
Batches sharing a group share one concurrency budget rather than each getting its own. Equals the batch's own id for a one-off batch; a recurring batch carries the id of the schedule that produced it.
Batch configuration
- Option 1
- Option 2
Show child attributes
Show child attributes
Creation timestamp
Number of items that could not be triggered and will not be retried
Unique identifier for the batch
Human-readable name for the batch
Number of pending items
When to start triggering executions
Current batch status
pending, running, paused, completed, cancelled Total number of items
Number of triggered items
Last update timestamp

