curl --request POST \
--url https://api.beamstudio.ai/agent-graphs/complete \
--header 'Content-Type: application/json' \
--header 'current-workspace-id: <current-workspace-id>' \
--header 'x-api-key: <api-key>' \
--data '
{
"agentName": "Bitcoin Price Agent",
"nodes": [
{
"id": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"objective": "Fetch the current Bitcoin price and return it to the user in a friendly format",
"evaluationCriteria": [
"The response contains a valid price number",
"The price is greater than 0"
],
"isEntryNode": true,
"isExitNode": false,
"xCoordinate": 116,
"yCoordinate": 150,
"isEvaluationEnabled": false,
"isAttachmentDataPulledIn": true,
"onError": "STOP",
"autoRetryWhenAccuracyLessThan": 80,
"autoRetryLimitWhenAccuracyIsLow": 1,
"autoRetryCountWhenFailure": 1,
"autoRetryWaitTimeWhenFailureInMs": 1000,
"enableAutoRetryWhenAccuracyIsLow": false,
"enableAutoRetryWhenFailure": false,
"childEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": true,
"conditionGroups": [
{
"rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
]
}
]
}
],
"parentEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": true,
"conditionGroups": [
{
"rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
]
}
]
}
],
"nodeType": "executionNode",
"nodeConfigurations": {
"conditionType": "llm_based",
"llmModel": "GPT40",
"fallbackModels": "GPT40,GPT4OMINI",
"waitType": "time_based",
"timeToWaitValue": 5,
"timeToWaitUnit": "minutes",
"linkedAgentGraphNodeId": "<string>",
"rule": "<string>",
"conditions": [
{
"conditions": [
{
"property": "<string>",
"value": "<string>"
}
]
}
],
"timeoutType": "no_timeout",
"timeoutValue": 123,
"onTimeout": "continue",
"iterationCount": 123,
"linkedVariableId": "d2cbeb35-9110-426c-967a-c0dba38289a9:items",
"alias": "<string>"
},
"parentNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9"
}
],
"agentDescription": "An AI agent that fetches real-time cryptocurrency prices and provides market insights",
"settings": {
"prompts": [
"What is the current Bitcoin price?",
"Can you fetch the latest cryptocurrency rates?"
]
}
}
'import requests
url = "https://api.beamstudio.ai/agent-graphs/complete"
payload = {
"agentName": "Bitcoin Price Agent",
"nodes": [
{
"id": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"objective": "Fetch the current Bitcoin price and return it to the user in a friendly format",
"evaluationCriteria": ["The response contains a valid price number", "The price is greater than 0"],
"isEntryNode": True,
"isExitNode": False,
"xCoordinate": 116,
"yCoordinate": 150,
"isEvaluationEnabled": False,
"isAttachmentDataPulledIn": True,
"onError": "STOP",
"autoRetryWhenAccuracyLessThan": 80,
"autoRetryLimitWhenAccuracyIsLow": 1,
"autoRetryCountWhenFailure": 1,
"autoRetryWaitTimeWhenFailureInMs": 1000,
"enableAutoRetryWhenAccuracyIsLow": False,
"enableAutoRetryWhenFailure": False,
"childEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": True,
"conditionGroups": [{ "rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
] }]
}
],
"parentEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": True,
"conditionGroups": [{ "rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
] }]
}
],
"nodeType": "executionNode",
"nodeConfigurations": {
"conditionType": "llm_based",
"llmModel": "GPT40",
"fallbackModels": "GPT40,GPT4OMINI",
"waitType": "time_based",
"timeToWaitValue": 5,
"timeToWaitUnit": "minutes",
"linkedAgentGraphNodeId": "<string>",
"rule": "<string>",
"conditions": [{ "conditions": [
{
"property": "<string>",
"value": "<string>"
}
] }],
"timeoutType": "no_timeout",
"timeoutValue": 123,
"onTimeout": "continue",
"iterationCount": 123,
"linkedVariableId": "d2cbeb35-9110-426c-967a-c0dba38289a9:items",
"alias": "<string>"
},
"parentNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9"
}
],
"agentDescription": "An AI agent that fetches real-time cryptocurrency prices and provides market insights",
"settings": { "prompts": ["What is the current Bitcoin price?", "Can you fetch the latest cryptocurrency rates?"] }
}
headers = {
"current-workspace-id": "<current-workspace-id>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'current-workspace-id': '<current-workspace-id>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentName: 'Bitcoin Price Agent',
nodes: [
{
id: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
objective: 'Fetch the current Bitcoin price and return it to the user in a friendly format',
evaluationCriteria: ['The response contains a valid price number', 'The price is greater than 0'],
isEntryNode: true,
isExitNode: false,
xCoordinate: 116,
yCoordinate: 150,
isEvaluationEnabled: false,
isAttachmentDataPulledIn: true,
onError: 'STOP',
autoRetryWhenAccuracyLessThan: 80,
autoRetryLimitWhenAccuracyIsLow: 1,
autoRetryCountWhenFailure: 1,
autoRetryWaitTimeWhenFailureInMs: 1000,
enableAutoRetryWhenAccuracyIsLow: false,
enableAutoRetryWhenFailure: false,
childEdges: [
{
sourceAgentGraphNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
targetAgentGraphNodeId: '22b6aa40-7d7c-449f-b151-0229834b48ba',
condition: 'price > 50000',
isAttachmentDataPulledIn: true,
conditionGroups: [
{
rules: [
{
sourceNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
sourceOutputParamName: 'status',
operator: 'equals',
comparisonValueType: 'static',
comparisonValue: 'success',
comparisonNodeId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
comparisonOutputParamName: 'expectedStatus'
}
]
}
]
}
],
parentEdges: [
{
sourceAgentGraphNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
targetAgentGraphNodeId: '22b6aa40-7d7c-449f-b151-0229834b48ba',
condition: 'price > 50000',
isAttachmentDataPulledIn: true,
conditionGroups: [
{
rules: [
{
sourceNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
sourceOutputParamName: 'status',
operator: 'equals',
comparisonValueType: 'static',
comparisonValue: 'success',
comparisonNodeId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
comparisonOutputParamName: 'expectedStatus'
}
]
}
]
}
],
nodeType: 'executionNode',
nodeConfigurations: {
conditionType: 'llm_based',
llmModel: 'GPT40',
fallbackModels: 'GPT40,GPT4OMINI',
waitType: 'time_based',
timeToWaitValue: 5,
timeToWaitUnit: 'minutes',
linkedAgentGraphNodeId: '<string>',
rule: '<string>',
conditions: [{conditions: [{property: '<string>', value: '<string>'}]}],
timeoutType: 'no_timeout',
timeoutValue: 123,
onTimeout: 'continue',
iterationCount: 123,
linkedVariableId: 'd2cbeb35-9110-426c-967a-c0dba38289a9:items',
alias: '<string>'
},
parentNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9'
}
],
agentDescription: 'An AI agent that fetches real-time cryptocurrency prices and provides market insights',
settings: {
prompts: [
'What is the current Bitcoin price?',
'Can you fetch the latest cryptocurrency rates?'
]
}
})
};
fetch('https://api.beamstudio.ai/agent-graphs/complete', 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.beamstudio.ai/agent-graphs/complete",
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([
'agentName' => 'Bitcoin Price Agent',
'nodes' => [
[
'id' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'objective' => 'Fetch the current Bitcoin price and return it to the user in a friendly format',
'evaluationCriteria' => [
'The response contains a valid price number',
'The price is greater than 0'
],
'isEntryNode' => true,
'isExitNode' => false,
'xCoordinate' => 116,
'yCoordinate' => 150,
'isEvaluationEnabled' => false,
'isAttachmentDataPulledIn' => true,
'onError' => 'STOP',
'autoRetryWhenAccuracyLessThan' => 80,
'autoRetryLimitWhenAccuracyIsLow' => 1,
'autoRetryCountWhenFailure' => 1,
'autoRetryWaitTimeWhenFailureInMs' => 1000,
'enableAutoRetryWhenAccuracyIsLow' => false,
'enableAutoRetryWhenFailure' => false,
'childEdges' => [
[
'sourceAgentGraphNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'targetAgentGraphNodeId' => '22b6aa40-7d7c-449f-b151-0229834b48ba',
'condition' => 'price > 50000',
'isAttachmentDataPulledIn' => true,
'conditionGroups' => [
[
'rules' => [
[
'sourceNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'sourceOutputParamName' => 'status',
'operator' => 'equals',
'comparisonValueType' => 'static',
'comparisonValue' => 'success',
'comparisonNodeId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'comparisonOutputParamName' => 'expectedStatus'
]
]
]
]
]
],
'parentEdges' => [
[
'sourceAgentGraphNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'targetAgentGraphNodeId' => '22b6aa40-7d7c-449f-b151-0229834b48ba',
'condition' => 'price > 50000',
'isAttachmentDataPulledIn' => true,
'conditionGroups' => [
[
'rules' => [
[
'sourceNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'sourceOutputParamName' => 'status',
'operator' => 'equals',
'comparisonValueType' => 'static',
'comparisonValue' => 'success',
'comparisonNodeId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'comparisonOutputParamName' => 'expectedStatus'
]
]
]
]
]
],
'nodeType' => 'executionNode',
'nodeConfigurations' => [
'conditionType' => 'llm_based',
'llmModel' => 'GPT40',
'fallbackModels' => 'GPT40,GPT4OMINI',
'waitType' => 'time_based',
'timeToWaitValue' => 5,
'timeToWaitUnit' => 'minutes',
'linkedAgentGraphNodeId' => '<string>',
'rule' => '<string>',
'conditions' => [
[
'conditions' => [
[
'property' => '<string>',
'value' => '<string>'
]
]
]
],
'timeoutType' => 'no_timeout',
'timeoutValue' => 123,
'onTimeout' => 'continue',
'iterationCount' => 123,
'linkedVariableId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9:items',
'alias' => '<string>'
],
'parentNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9'
]
],
'agentDescription' => 'An AI agent that fetches real-time cryptocurrency prices and provides market insights',
'settings' => [
'prompts' => [
'What is the current Bitcoin price?',
'Can you fetch the latest cryptocurrency rates?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"current-workspace-id: <current-workspace-id>",
"x-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://api.beamstudio.ai/agent-graphs/complete"
payload := strings.NewReader("{\n \"agentName\": \"Bitcoin Price Agent\",\n \"nodes\": [\n {\n \"id\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"objective\": \"Fetch the current Bitcoin price and return it to the user in a friendly format\",\n \"evaluationCriteria\": [\n \"The response contains a valid price number\",\n \"The price is greater than 0\"\n ],\n \"isEntryNode\": true,\n \"isExitNode\": false,\n \"xCoordinate\": 116,\n \"yCoordinate\": 150,\n \"isEvaluationEnabled\": false,\n \"isAttachmentDataPulledIn\": true,\n \"onError\": \"STOP\",\n \"autoRetryWhenAccuracyLessThan\": 80,\n \"autoRetryLimitWhenAccuracyIsLow\": 1,\n \"autoRetryCountWhenFailure\": 1,\n \"autoRetryWaitTimeWhenFailureInMs\": 1000,\n \"enableAutoRetryWhenAccuracyIsLow\": false,\n \"enableAutoRetryWhenFailure\": false,\n \"childEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"parentEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"nodeType\": \"executionNode\",\n \"nodeConfigurations\": {\n \"conditionType\": \"llm_based\",\n \"llmModel\": \"GPT40\",\n \"fallbackModels\": \"GPT40,GPT4OMINI\",\n \"waitType\": \"time_based\",\n \"timeToWaitValue\": 5,\n \"timeToWaitUnit\": \"minutes\",\n \"linkedAgentGraphNodeId\": \"<string>\",\n \"rule\": \"<string>\",\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"timeoutType\": \"no_timeout\",\n \"timeoutValue\": 123,\n \"onTimeout\": \"continue\",\n \"iterationCount\": 123,\n \"linkedVariableId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9:items\",\n \"alias\": \"<string>\"\n },\n \"parentNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\"\n }\n ],\n \"agentDescription\": \"An AI agent that fetches real-time cryptocurrency prices and provides market insights\",\n \"settings\": {\n \"prompts\": [\n \"What is the current Bitcoin price?\",\n \"Can you fetch the latest cryptocurrency rates?\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("current-workspace-id", "<current-workspace-id>")
req.Header.Add("x-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://api.beamstudio.ai/agent-graphs/complete")
.header("current-workspace-id", "<current-workspace-id>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentName\": \"Bitcoin Price Agent\",\n \"nodes\": [\n {\n \"id\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"objective\": \"Fetch the current Bitcoin price and return it to the user in a friendly format\",\n \"evaluationCriteria\": [\n \"The response contains a valid price number\",\n \"The price is greater than 0\"\n ],\n \"isEntryNode\": true,\n \"isExitNode\": false,\n \"xCoordinate\": 116,\n \"yCoordinate\": 150,\n \"isEvaluationEnabled\": false,\n \"isAttachmentDataPulledIn\": true,\n \"onError\": \"STOP\",\n \"autoRetryWhenAccuracyLessThan\": 80,\n \"autoRetryLimitWhenAccuracyIsLow\": 1,\n \"autoRetryCountWhenFailure\": 1,\n \"autoRetryWaitTimeWhenFailureInMs\": 1000,\n \"enableAutoRetryWhenAccuracyIsLow\": false,\n \"enableAutoRetryWhenFailure\": false,\n \"childEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"parentEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"nodeType\": \"executionNode\",\n \"nodeConfigurations\": {\n \"conditionType\": \"llm_based\",\n \"llmModel\": \"GPT40\",\n \"fallbackModels\": \"GPT40,GPT4OMINI\",\n \"waitType\": \"time_based\",\n \"timeToWaitValue\": 5,\n \"timeToWaitUnit\": \"minutes\",\n \"linkedAgentGraphNodeId\": \"<string>\",\n \"rule\": \"<string>\",\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"timeoutType\": \"no_timeout\",\n \"timeoutValue\": 123,\n \"onTimeout\": \"continue\",\n \"iterationCount\": 123,\n \"linkedVariableId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9:items\",\n \"alias\": \"<string>\"\n },\n \"parentNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\"\n }\n ],\n \"agentDescription\": \"An AI agent that fetches real-time cryptocurrency prices and provides market insights\",\n \"settings\": {\n \"prompts\": [\n \"What is the current Bitcoin price?\",\n \"Can you fetch the latest cryptocurrency rates?\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beamstudio.ai/agent-graphs/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["current-workspace-id"] = '<current-workspace-id>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentName\": \"Bitcoin Price Agent\",\n \"nodes\": [\n {\n \"id\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"objective\": \"Fetch the current Bitcoin price and return it to the user in a friendly format\",\n \"evaluationCriteria\": [\n \"The response contains a valid price number\",\n \"The price is greater than 0\"\n ],\n \"isEntryNode\": true,\n \"isExitNode\": false,\n \"xCoordinate\": 116,\n \"yCoordinate\": 150,\n \"isEvaluationEnabled\": false,\n \"isAttachmentDataPulledIn\": true,\n \"onError\": \"STOP\",\n \"autoRetryWhenAccuracyLessThan\": 80,\n \"autoRetryLimitWhenAccuracyIsLow\": 1,\n \"autoRetryCountWhenFailure\": 1,\n \"autoRetryWaitTimeWhenFailureInMs\": 1000,\n \"enableAutoRetryWhenAccuracyIsLow\": false,\n \"enableAutoRetryWhenFailure\": false,\n \"childEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"parentEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"nodeType\": \"executionNode\",\n \"nodeConfigurations\": {\n \"conditionType\": \"llm_based\",\n \"llmModel\": \"GPT40\",\n \"fallbackModels\": \"GPT40,GPT4OMINI\",\n \"waitType\": \"time_based\",\n \"timeToWaitValue\": 5,\n \"timeToWaitUnit\": \"minutes\",\n \"linkedAgentGraphNodeId\": \"<string>\",\n \"rule\": \"<string>\",\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"timeoutType\": \"no_timeout\",\n \"timeoutValue\": 123,\n \"onTimeout\": \"continue\",\n \"iterationCount\": 123,\n \"linkedVariableId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9:items\",\n \"alias\": \"<string>\"\n },\n \"parentNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\"\n }\n ],\n \"agentDescription\": \"An AI agent that fetches real-time cryptocurrency prices and provides market insights\",\n \"settings\": {\n \"prompts\": [\n \"What is the current Bitcoin price?\",\n \"Can you fetch the latest cryptocurrency rates?\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"agentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"agentName": "My AI Agent",
"activeGraphId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"draftGraphId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}Create a complete agent graph
Creates a new agent with its complete graph structure including nodes, edges, and tool configurations. Both an active/published graph and a draft graph are created.
curl --request POST \
--url https://api.beamstudio.ai/agent-graphs/complete \
--header 'Content-Type: application/json' \
--header 'current-workspace-id: <current-workspace-id>' \
--header 'x-api-key: <api-key>' \
--data '
{
"agentName": "Bitcoin Price Agent",
"nodes": [
{
"id": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"objective": "Fetch the current Bitcoin price and return it to the user in a friendly format",
"evaluationCriteria": [
"The response contains a valid price number",
"The price is greater than 0"
],
"isEntryNode": true,
"isExitNode": false,
"xCoordinate": 116,
"yCoordinate": 150,
"isEvaluationEnabled": false,
"isAttachmentDataPulledIn": true,
"onError": "STOP",
"autoRetryWhenAccuracyLessThan": 80,
"autoRetryLimitWhenAccuracyIsLow": 1,
"autoRetryCountWhenFailure": 1,
"autoRetryWaitTimeWhenFailureInMs": 1000,
"enableAutoRetryWhenAccuracyIsLow": false,
"enableAutoRetryWhenFailure": false,
"childEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": true,
"conditionGroups": [
{
"rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
]
}
]
}
],
"parentEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": true,
"conditionGroups": [
{
"rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
]
}
]
}
],
"nodeType": "executionNode",
"nodeConfigurations": {
"conditionType": "llm_based",
"llmModel": "GPT40",
"fallbackModels": "GPT40,GPT4OMINI",
"waitType": "time_based",
"timeToWaitValue": 5,
"timeToWaitUnit": "minutes",
"linkedAgentGraphNodeId": "<string>",
"rule": "<string>",
"conditions": [
{
"conditions": [
{
"property": "<string>",
"value": "<string>"
}
]
}
],
"timeoutType": "no_timeout",
"timeoutValue": 123,
"onTimeout": "continue",
"iterationCount": 123,
"linkedVariableId": "d2cbeb35-9110-426c-967a-c0dba38289a9:items",
"alias": "<string>"
},
"parentNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9"
}
],
"agentDescription": "An AI agent that fetches real-time cryptocurrency prices and provides market insights",
"settings": {
"prompts": [
"What is the current Bitcoin price?",
"Can you fetch the latest cryptocurrency rates?"
]
}
}
'import requests
url = "https://api.beamstudio.ai/agent-graphs/complete"
payload = {
"agentName": "Bitcoin Price Agent",
"nodes": [
{
"id": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"objective": "Fetch the current Bitcoin price and return it to the user in a friendly format",
"evaluationCriteria": ["The response contains a valid price number", "The price is greater than 0"],
"isEntryNode": True,
"isExitNode": False,
"xCoordinate": 116,
"yCoordinate": 150,
"isEvaluationEnabled": False,
"isAttachmentDataPulledIn": True,
"onError": "STOP",
"autoRetryWhenAccuracyLessThan": 80,
"autoRetryLimitWhenAccuracyIsLow": 1,
"autoRetryCountWhenFailure": 1,
"autoRetryWaitTimeWhenFailureInMs": 1000,
"enableAutoRetryWhenAccuracyIsLow": False,
"enableAutoRetryWhenFailure": False,
"childEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": True,
"conditionGroups": [{ "rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
] }]
}
],
"parentEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"isAttachmentDataPulledIn": True,
"conditionGroups": [{ "rules": [
{
"sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"sourceOutputParamName": "status",
"operator": "equals",
"comparisonValueType": "static",
"comparisonValue": "success",
"comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"comparisonOutputParamName": "expectedStatus"
}
] }]
}
],
"nodeType": "executionNode",
"nodeConfigurations": {
"conditionType": "llm_based",
"llmModel": "GPT40",
"fallbackModels": "GPT40,GPT4OMINI",
"waitType": "time_based",
"timeToWaitValue": 5,
"timeToWaitUnit": "minutes",
"linkedAgentGraphNodeId": "<string>",
"rule": "<string>",
"conditions": [{ "conditions": [
{
"property": "<string>",
"value": "<string>"
}
] }],
"timeoutType": "no_timeout",
"timeoutValue": 123,
"onTimeout": "continue",
"iterationCount": 123,
"linkedVariableId": "d2cbeb35-9110-426c-967a-c0dba38289a9:items",
"alias": "<string>"
},
"parentNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9"
}
],
"agentDescription": "An AI agent that fetches real-time cryptocurrency prices and provides market insights",
"settings": { "prompts": ["What is the current Bitcoin price?", "Can you fetch the latest cryptocurrency rates?"] }
}
headers = {
"current-workspace-id": "<current-workspace-id>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'current-workspace-id': '<current-workspace-id>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentName: 'Bitcoin Price Agent',
nodes: [
{
id: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
objective: 'Fetch the current Bitcoin price and return it to the user in a friendly format',
evaluationCriteria: ['The response contains a valid price number', 'The price is greater than 0'],
isEntryNode: true,
isExitNode: false,
xCoordinate: 116,
yCoordinate: 150,
isEvaluationEnabled: false,
isAttachmentDataPulledIn: true,
onError: 'STOP',
autoRetryWhenAccuracyLessThan: 80,
autoRetryLimitWhenAccuracyIsLow: 1,
autoRetryCountWhenFailure: 1,
autoRetryWaitTimeWhenFailureInMs: 1000,
enableAutoRetryWhenAccuracyIsLow: false,
enableAutoRetryWhenFailure: false,
childEdges: [
{
sourceAgentGraphNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
targetAgentGraphNodeId: '22b6aa40-7d7c-449f-b151-0229834b48ba',
condition: 'price > 50000',
isAttachmentDataPulledIn: true,
conditionGroups: [
{
rules: [
{
sourceNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
sourceOutputParamName: 'status',
operator: 'equals',
comparisonValueType: 'static',
comparisonValue: 'success',
comparisonNodeId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
comparisonOutputParamName: 'expectedStatus'
}
]
}
]
}
],
parentEdges: [
{
sourceAgentGraphNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
targetAgentGraphNodeId: '22b6aa40-7d7c-449f-b151-0229834b48ba',
condition: 'price > 50000',
isAttachmentDataPulledIn: true,
conditionGroups: [
{
rules: [
{
sourceNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9',
sourceOutputParamName: 'status',
operator: 'equals',
comparisonValueType: 'static',
comparisonValue: 'success',
comparisonNodeId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
comparisonOutputParamName: 'expectedStatus'
}
]
}
]
}
],
nodeType: 'executionNode',
nodeConfigurations: {
conditionType: 'llm_based',
llmModel: 'GPT40',
fallbackModels: 'GPT40,GPT4OMINI',
waitType: 'time_based',
timeToWaitValue: 5,
timeToWaitUnit: 'minutes',
linkedAgentGraphNodeId: '<string>',
rule: '<string>',
conditions: [{conditions: [{property: '<string>', value: '<string>'}]}],
timeoutType: 'no_timeout',
timeoutValue: 123,
onTimeout: 'continue',
iterationCount: 123,
linkedVariableId: 'd2cbeb35-9110-426c-967a-c0dba38289a9:items',
alias: '<string>'
},
parentNodeId: 'd2cbeb35-9110-426c-967a-c0dba38289a9'
}
],
agentDescription: 'An AI agent that fetches real-time cryptocurrency prices and provides market insights',
settings: {
prompts: [
'What is the current Bitcoin price?',
'Can you fetch the latest cryptocurrency rates?'
]
}
})
};
fetch('https://api.beamstudio.ai/agent-graphs/complete', 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.beamstudio.ai/agent-graphs/complete",
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([
'agentName' => 'Bitcoin Price Agent',
'nodes' => [
[
'id' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'objective' => 'Fetch the current Bitcoin price and return it to the user in a friendly format',
'evaluationCriteria' => [
'The response contains a valid price number',
'The price is greater than 0'
],
'isEntryNode' => true,
'isExitNode' => false,
'xCoordinate' => 116,
'yCoordinate' => 150,
'isEvaluationEnabled' => false,
'isAttachmentDataPulledIn' => true,
'onError' => 'STOP',
'autoRetryWhenAccuracyLessThan' => 80,
'autoRetryLimitWhenAccuracyIsLow' => 1,
'autoRetryCountWhenFailure' => 1,
'autoRetryWaitTimeWhenFailureInMs' => 1000,
'enableAutoRetryWhenAccuracyIsLow' => false,
'enableAutoRetryWhenFailure' => false,
'childEdges' => [
[
'sourceAgentGraphNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'targetAgentGraphNodeId' => '22b6aa40-7d7c-449f-b151-0229834b48ba',
'condition' => 'price > 50000',
'isAttachmentDataPulledIn' => true,
'conditionGroups' => [
[
'rules' => [
[
'sourceNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'sourceOutputParamName' => 'status',
'operator' => 'equals',
'comparisonValueType' => 'static',
'comparisonValue' => 'success',
'comparisonNodeId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'comparisonOutputParamName' => 'expectedStatus'
]
]
]
]
]
],
'parentEdges' => [
[
'sourceAgentGraphNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'targetAgentGraphNodeId' => '22b6aa40-7d7c-449f-b151-0229834b48ba',
'condition' => 'price > 50000',
'isAttachmentDataPulledIn' => true,
'conditionGroups' => [
[
'rules' => [
[
'sourceNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9',
'sourceOutputParamName' => 'status',
'operator' => 'equals',
'comparisonValueType' => 'static',
'comparisonValue' => 'success',
'comparisonNodeId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'comparisonOutputParamName' => 'expectedStatus'
]
]
]
]
]
],
'nodeType' => 'executionNode',
'nodeConfigurations' => [
'conditionType' => 'llm_based',
'llmModel' => 'GPT40',
'fallbackModels' => 'GPT40,GPT4OMINI',
'waitType' => 'time_based',
'timeToWaitValue' => 5,
'timeToWaitUnit' => 'minutes',
'linkedAgentGraphNodeId' => '<string>',
'rule' => '<string>',
'conditions' => [
[
'conditions' => [
[
'property' => '<string>',
'value' => '<string>'
]
]
]
],
'timeoutType' => 'no_timeout',
'timeoutValue' => 123,
'onTimeout' => 'continue',
'iterationCount' => 123,
'linkedVariableId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9:items',
'alias' => '<string>'
],
'parentNodeId' => 'd2cbeb35-9110-426c-967a-c0dba38289a9'
]
],
'agentDescription' => 'An AI agent that fetches real-time cryptocurrency prices and provides market insights',
'settings' => [
'prompts' => [
'What is the current Bitcoin price?',
'Can you fetch the latest cryptocurrency rates?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"current-workspace-id: <current-workspace-id>",
"x-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://api.beamstudio.ai/agent-graphs/complete"
payload := strings.NewReader("{\n \"agentName\": \"Bitcoin Price Agent\",\n \"nodes\": [\n {\n \"id\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"objective\": \"Fetch the current Bitcoin price and return it to the user in a friendly format\",\n \"evaluationCriteria\": [\n \"The response contains a valid price number\",\n \"The price is greater than 0\"\n ],\n \"isEntryNode\": true,\n \"isExitNode\": false,\n \"xCoordinate\": 116,\n \"yCoordinate\": 150,\n \"isEvaluationEnabled\": false,\n \"isAttachmentDataPulledIn\": true,\n \"onError\": \"STOP\",\n \"autoRetryWhenAccuracyLessThan\": 80,\n \"autoRetryLimitWhenAccuracyIsLow\": 1,\n \"autoRetryCountWhenFailure\": 1,\n \"autoRetryWaitTimeWhenFailureInMs\": 1000,\n \"enableAutoRetryWhenAccuracyIsLow\": false,\n \"enableAutoRetryWhenFailure\": false,\n \"childEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"parentEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"nodeType\": \"executionNode\",\n \"nodeConfigurations\": {\n \"conditionType\": \"llm_based\",\n \"llmModel\": \"GPT40\",\n \"fallbackModels\": \"GPT40,GPT4OMINI\",\n \"waitType\": \"time_based\",\n \"timeToWaitValue\": 5,\n \"timeToWaitUnit\": \"minutes\",\n \"linkedAgentGraphNodeId\": \"<string>\",\n \"rule\": \"<string>\",\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"timeoutType\": \"no_timeout\",\n \"timeoutValue\": 123,\n \"onTimeout\": \"continue\",\n \"iterationCount\": 123,\n \"linkedVariableId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9:items\",\n \"alias\": \"<string>\"\n },\n \"parentNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\"\n }\n ],\n \"agentDescription\": \"An AI agent that fetches real-time cryptocurrency prices and provides market insights\",\n \"settings\": {\n \"prompts\": [\n \"What is the current Bitcoin price?\",\n \"Can you fetch the latest cryptocurrency rates?\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("current-workspace-id", "<current-workspace-id>")
req.Header.Add("x-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://api.beamstudio.ai/agent-graphs/complete")
.header("current-workspace-id", "<current-workspace-id>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentName\": \"Bitcoin Price Agent\",\n \"nodes\": [\n {\n \"id\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"objective\": \"Fetch the current Bitcoin price and return it to the user in a friendly format\",\n \"evaluationCriteria\": [\n \"The response contains a valid price number\",\n \"The price is greater than 0\"\n ],\n \"isEntryNode\": true,\n \"isExitNode\": false,\n \"xCoordinate\": 116,\n \"yCoordinate\": 150,\n \"isEvaluationEnabled\": false,\n \"isAttachmentDataPulledIn\": true,\n \"onError\": \"STOP\",\n \"autoRetryWhenAccuracyLessThan\": 80,\n \"autoRetryLimitWhenAccuracyIsLow\": 1,\n \"autoRetryCountWhenFailure\": 1,\n \"autoRetryWaitTimeWhenFailureInMs\": 1000,\n \"enableAutoRetryWhenAccuracyIsLow\": false,\n \"enableAutoRetryWhenFailure\": false,\n \"childEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"parentEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"nodeType\": \"executionNode\",\n \"nodeConfigurations\": {\n \"conditionType\": \"llm_based\",\n \"llmModel\": \"GPT40\",\n \"fallbackModels\": \"GPT40,GPT4OMINI\",\n \"waitType\": \"time_based\",\n \"timeToWaitValue\": 5,\n \"timeToWaitUnit\": \"minutes\",\n \"linkedAgentGraphNodeId\": \"<string>\",\n \"rule\": \"<string>\",\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"timeoutType\": \"no_timeout\",\n \"timeoutValue\": 123,\n \"onTimeout\": \"continue\",\n \"iterationCount\": 123,\n \"linkedVariableId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9:items\",\n \"alias\": \"<string>\"\n },\n \"parentNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\"\n }\n ],\n \"agentDescription\": \"An AI agent that fetches real-time cryptocurrency prices and provides market insights\",\n \"settings\": {\n \"prompts\": [\n \"What is the current Bitcoin price?\",\n \"Can you fetch the latest cryptocurrency rates?\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beamstudio.ai/agent-graphs/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["current-workspace-id"] = '<current-workspace-id>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentName\": \"Bitcoin Price Agent\",\n \"nodes\": [\n {\n \"id\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"objective\": \"Fetch the current Bitcoin price and return it to the user in a friendly format\",\n \"evaluationCriteria\": [\n \"The response contains a valid price number\",\n \"The price is greater than 0\"\n ],\n \"isEntryNode\": true,\n \"isExitNode\": false,\n \"xCoordinate\": 116,\n \"yCoordinate\": 150,\n \"isEvaluationEnabled\": false,\n \"isAttachmentDataPulledIn\": true,\n \"onError\": \"STOP\",\n \"autoRetryWhenAccuracyLessThan\": 80,\n \"autoRetryLimitWhenAccuracyIsLow\": 1,\n \"autoRetryCountWhenFailure\": 1,\n \"autoRetryWaitTimeWhenFailureInMs\": 1000,\n \"enableAutoRetryWhenAccuracyIsLow\": false,\n \"enableAutoRetryWhenFailure\": false,\n \"childEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"parentEdges\": [\n {\n \"sourceAgentGraphNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"targetAgentGraphNodeId\": \"22b6aa40-7d7c-449f-b151-0229834b48ba\",\n \"condition\": \"price > 50000\",\n \"isAttachmentDataPulledIn\": true,\n \"conditionGroups\": [\n {\n \"rules\": [\n {\n \"sourceNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\",\n \"sourceOutputParamName\": \"status\",\n \"operator\": \"equals\",\n \"comparisonValueType\": \"static\",\n \"comparisonValue\": \"success\",\n \"comparisonNodeId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"comparisonOutputParamName\": \"expectedStatus\"\n }\n ]\n }\n ]\n }\n ],\n \"nodeType\": \"executionNode\",\n \"nodeConfigurations\": {\n \"conditionType\": \"llm_based\",\n \"llmModel\": \"GPT40\",\n \"fallbackModels\": \"GPT40,GPT4OMINI\",\n \"waitType\": \"time_based\",\n \"timeToWaitValue\": 5,\n \"timeToWaitUnit\": \"minutes\",\n \"linkedAgentGraphNodeId\": \"<string>\",\n \"rule\": \"<string>\",\n \"conditions\": [\n {\n \"conditions\": [\n {\n \"property\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"timeoutType\": \"no_timeout\",\n \"timeoutValue\": 123,\n \"onTimeout\": \"continue\",\n \"iterationCount\": 123,\n \"linkedVariableId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9:items\",\n \"alias\": \"<string>\"\n },\n \"parentNodeId\": \"d2cbeb35-9110-426c-967a-c0dba38289a9\"\n }\n ],\n \"agentDescription\": \"An AI agent that fetches real-time cryptocurrency prices and provides market insights\",\n \"settings\": {\n \"prompts\": [\n \"What is the current Bitcoin price?\",\n \"Can you fetch the latest cryptocurrency rates?\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"agentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"agentName": "My AI Agent",
"activeGraphId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"draftGraphId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}Authorizations
Headers
Body
The name of the agent to be created. This will be displayed in the UI and used to identify the agent
"Bitcoin Price Agent"
The complete list of nodes that make up the agent workflow graph. Nodes are connected by edges to form the execution flow. Must include at least one entry node (isEntryNode: true). Each node can have a tool configuration and is connected to other nodes via edges
Show child attributes
Show child attributes
A detailed description of what the agent does and its capabilities
"An AI agent that fetches real-time cryptocurrency prices and provides market insights"
Configuration settings for the agent including personality, restrictions, and suggested prompts
Show child attributes
Show child attributes
Response
Agent and graph created successfully
UUID of the created agent
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
Name of the created agent
"My AI Agent"
UUID of the active/published graph
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
UUID of the draft graph
"b2c3d4e5-f6a7-8901-bcde-f12345678901"