Update agent and its draft graph
curl --request PUT \
--url https://api.beamstudio.ai/agent-graphs/{agentId} \
--header 'Content-Type: application/json' \
--header 'current-workspace-id: <current-workspace-id>' \
--header 'x-api-key: <api-key>' \
--data '
{
"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"
}
],
"agentName": "Updated Bitcoin Price Agent",
"agentDescription": "An improved agent that fetches cryptocurrency prices with better error handling",
"settings": {
"prompts": [
"What is the current Bitcoin price?",
"Can you fetch the latest cryptocurrency rates?"
]
}
}
'import requests
url = "https://api.beamstudio.ai/agent-graphs/{agentId}"
payload = {
"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"
}
],
"agentName": "Updated Bitcoin Price Agent",
"agentDescription": "An improved agent that fetches cryptocurrency prices with better error handling",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'current-workspace-id': '<current-workspace-id>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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'
}
],
agentName: 'Updated Bitcoin Price Agent',
agentDescription: 'An improved agent that fetches cryptocurrency prices with better error handling',
settings: {
prompts: [
'What is the current Bitcoin price?',
'Can you fetch the latest cryptocurrency rates?'
]
}
})
};
fetch('https://api.beamstudio.ai/agent-graphs/{agentId}', 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/{agentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
],
'agentName' => 'Updated Bitcoin Price Agent',
'agentDescription' => 'An improved agent that fetches cryptocurrency prices with better error handling',
'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/{agentId}"
payload := strings.NewReader("{\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 \"agentName\": \"Updated Bitcoin Price Agent\",\n \"agentDescription\": \"An improved agent that fetches cryptocurrency prices with better error handling\",\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("PUT", 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.put("https://api.beamstudio.ai/agent-graphs/{agentId}")
.header("current-workspace-id", "<current-workspace-id>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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 \"agentName\": \"Updated Bitcoin Price Agent\",\n \"agentDescription\": \"An improved agent that fetches cryptocurrency prices with better error handling\",\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/{agentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["current-workspace-id"] = '<current-workspace-id>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\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 \"agentName\": \"Updated Bitcoin Price Agent\",\n \"agentDescription\": \"An improved agent that fetches cryptocurrency prices with better error handling\",\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{
"draftGraphId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"agentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"agentName": "My AI Agent"
}Agent Graph
Update agent and its draft graph
Updates an existing agent (name, description, settings) and replaces all nodes and edges in its draft graph.
PUT
/
agent-graphs
/
{agentId}
Update agent and its draft graph
curl --request PUT \
--url https://api.beamstudio.ai/agent-graphs/{agentId} \
--header 'Content-Type: application/json' \
--header 'current-workspace-id: <current-workspace-id>' \
--header 'x-api-key: <api-key>' \
--data '
{
"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"
}
],
"agentName": "Updated Bitcoin Price Agent",
"agentDescription": "An improved agent that fetches cryptocurrency prices with better error handling",
"settings": {
"prompts": [
"What is the current Bitcoin price?",
"Can you fetch the latest cryptocurrency rates?"
]
}
}
'import requests
url = "https://api.beamstudio.ai/agent-graphs/{agentId}"
payload = {
"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"
}
],
"agentName": "Updated Bitcoin Price Agent",
"agentDescription": "An improved agent that fetches cryptocurrency prices with better error handling",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'current-workspace-id': '<current-workspace-id>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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'
}
],
agentName: 'Updated Bitcoin Price Agent',
agentDescription: 'An improved agent that fetches cryptocurrency prices with better error handling',
settings: {
prompts: [
'What is the current Bitcoin price?',
'Can you fetch the latest cryptocurrency rates?'
]
}
})
};
fetch('https://api.beamstudio.ai/agent-graphs/{agentId}', 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/{agentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
],
'agentName' => 'Updated Bitcoin Price Agent',
'agentDescription' => 'An improved agent that fetches cryptocurrency prices with better error handling',
'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/{agentId}"
payload := strings.NewReader("{\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 \"agentName\": \"Updated Bitcoin Price Agent\",\n \"agentDescription\": \"An improved agent that fetches cryptocurrency prices with better error handling\",\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("PUT", 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.put("https://api.beamstudio.ai/agent-graphs/{agentId}")
.header("current-workspace-id", "<current-workspace-id>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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 \"agentName\": \"Updated Bitcoin Price Agent\",\n \"agentDescription\": \"An improved agent that fetches cryptocurrency prices with better error handling\",\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/{agentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["current-workspace-id"] = '<current-workspace-id>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\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 \"agentName\": \"Updated Bitcoin Price Agent\",\n \"agentDescription\": \"An improved agent that fetches cryptocurrency prices with better error handling\",\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{
"draftGraphId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"agentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"agentName": "My AI Agent"
}Query Parameters
Body
application/json
Response
Agent and graph updated successfully (draft only)