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",
"nextRuleOperator": "AND"
}
],
"nextGroupOperator": "AND"
}
]
}
],
"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",
"nextRuleOperator": "AND"
}
],
"nextGroupOperator": "AND"
}
]
}
],
"nodeType": "executionNode",
"nodeConfigurations": {
"conditionType": "llm_based",
"llmModel": "GPT40",
"fallbackModels": "GPT40,GPT4OMINI",
"waitType": "time_based",
"timeToWaitValue": 30,
"timeToWaitUnit": "minutes",
"timeoutType": "time_based",
"timeoutValue": 60,
"timeoutUnit": "minutes",
"onTimeout": "continue",
"rule": "output.status == \"success\"",
"conditions": [
{}
],
"linkedAgentGraphNodeId": "node-123e4567-e89b-12d3-a456-426614174000"
}
}
],
"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?"
]
}
}
'