Skip to main content
GET
/
api
/
v1
/
flows
/
executions
/
{execution_id}
Get Execution
curl --request GET \
  --url https://agent-studio.thena.ai/api/v1/flows/executions/{execution_id} \
  --header 'x-api-key: <api-key>'
import requests

url = "https://agent-studio.thena.ai/api/v1/flows/executions/{execution_id}"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://agent-studio.thena.ai/api/v1/flows/executions/{execution_id}', 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://agent-studio.thena.ai/api/v1/flows/executions/{execution_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "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"
	"net/http"
	"io"
)

func main() {

	url := "https://agent-studio.thena.ai/api/v1/flows/executions/{execution_id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://agent-studio.thena.ai/api/v1/flows/executions/{execution_id}")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://agent-studio.thena.ai/api/v1/flows/executions/{execution_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "flow_id": "<string>",
  "agent_id": "<string>",
  "organization_id": "<string>",
  "execution_number": 123,
  "started_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "trigger_data": {},
  "variables": {},
  "completed_at": "2023-11-07T05:31:56Z",
  "duration_ms": 123,
  "timeout_seconds": 300,
  "steps": [
    {
      "step_id": "<string>",
      "step_name": "<string>",
      "step_type": "<string>",
      "started_at": "2023-11-07T05:31:56Z",
      "tool_name": "<string>",
      "input_data": {},
      "output_data": {},
      "error_message": "<string>",
      "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"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Path Parameters

execution_id
string
required

Response

Successful Response

Complete flow execution record.

flow_id
string
required

ID of the executed flow

agent_id
string
required

ID of the agent that owns the flow

organization_id
string
required

Organization ID

execution_number
integer
required

Sequential execution number for this flow

trigger_type
enum<string>
required

How the execution was triggered

Available options:
manual,
event,
scheduled,
api,
webhook,
test
priority
enum<string>
required

Execution priority

Available options:
low,
normal,
high,
urgent
status
enum<string>
required

Current execution status

Available options:
pending,
queued,
running,
completed,
failed,
cancelled,
timeout,
retrying
started_at
string<date-time>
required

When execution started

id
string

Unique execution ID

trigger_data
Trigger Data · object

Original trigger data

variables
Variables · object

Execution variables

completed_at
string<date-time> | null

When execution completed

duration_ms
integer | null

Total execution duration in milliseconds

timeout_seconds
integer
default:300

Execution timeout

steps
FlowExecutionStep · object[]

Execution steps

final_output
Final Output · object

Final execution output

error_message
string | null

Error message if execution failed

error_details
Error Details · object

Detailed error information

retry_count
integer
default:0

Number of retries attempted

max_retries
integer
default:3

Maximum number of retries

parent_execution_id
string | null

Parent execution if this is a retry

tokens_used
integer | null

Total tokens used in LLM calls

tool_calls_count
integer
default:0

Number of tool calls made

cost_estimate
number | null

Estimated cost in USD

performance_metrics
Performance Metrics · object

Performance metrics

metadata
Metadata · object

Additional execution metadata

created_at
string<date-time>

When record was created

updated_at
string<date-time>

When record was last updated