Skip to main content
POST
/
api
/
v1
/
flows
/
execute
Execute Flow
curl --request POST \
  --url https://agent-studio.thena.ai/api/v1/flows/execute \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "flow_id": "<string>",
  "trigger_type": "manual",
  "trigger_data": {},
  "variables": {},
  "priority": "normal",
  "scheduled_at": "2023-11-07T05:31:56Z",
  "timeout_seconds": 123,
  "retry_config": {},
  "metadata": {}
}'
{
  "execution": {
    "id": "<string>",
    "flow_id": "<string>",
    "agent_id": "<string>",
    "organization_id": "<string>",
    "execution_number": 123,
    "trigger_type": "manual",
    "trigger_data": {},
    "variables": {},
    "priority": "low",
    "status": "pending",
    "started_at": "2023-11-07T05:31:56Z",
    "completed_at": "2023-11-07T05:31:56Z",
    "duration_ms": 123,
    "timeout_seconds": 300,
    "steps": [
      {
        "step_id": "<string>",
        "step_name": "<string>",
        "step_type": "<string>",
        "tool_name": "<string>",
        "status": "pending",
        "input_data": {},
        "output_data": {},
        "error_message": "<string>",
        "started_at": "2023-11-07T05:31:56Z",
        "completed_at": "2023-11-07T05:31:56Z",
        "duration_ms": 123,
        "retry_count": 0,
        "metadata": {}
      }
    ],
    "final_output": {},
    "error_message": "<string>",
    "error_details": {},
    "retry_count": 0,
    "max_retries": 3,
    "parent_execution_id": "<string>",
    "tokens_used": 123,
    "tool_calls_count": 0,
    "cost_estimate": 123,
    "performance_metrics": {},
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  },
  "message": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Request model for creating a flow execution.

flow_id
string
required

ID of the flow to execute

trigger_type
enum<string>
required

How the execution was triggered

Available options:
manual,
event,
scheduled,
api,
webhook,
test
trigger_data
object

Data from the trigger event

variables
object

Additional variables for execution

priority
enum<string>

Execution priority

Available options:
low,
normal,
high,
urgent
scheduled_at
string<date-time> | null

When to execute (for scheduled executions)

timeout_seconds
integer | null
default:300

Execution timeout in seconds

retry_config
object | null

Retry configuration

metadata
object

Additional execution metadata

Response

Successful Response

Response model for flow execution operations.

execution
object
required

Execution details

message
string
required

Response message

I