Skip to main content

Get Run

Retrieve detailed information about a specific ActionFlows run via the REST API, including its status, timing, and results.

Get Run

Retrieve detailed information about a specific run.

Endpoint

GET /api/runs/{runId}

Try it

Live requests run from your browser. Open the API Explorer to try every operation from one screen.

get/api/runs/{runId}

Get run

Requests go to the live API from your browser. The docs server never sees this key.

curl -X GET 'https://api.actionflows.ai/api/runs/{runId}' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json'

Response

Send a request to see the response.

Authentication

Required. See API Reference for authentication details.

Path Parameters

ParameterTypeRequiredDescription
runIdstringYesThe unique identifier of the run (must start with run_)

Response

Success Response (200 OK)

{
  "success": true,
  "data": {
    "id": "run_123",
    "status": "COMPLETED",
    "payload": {
      "organizationId": "org_123",
      "actionFlowId": "flow_123",
      "inputs": {
        "node_abc_prompt": "Hello"
      },
      "triggerSource": "api"
    },
    "output": {
      "success": true,
      "result": {
        "executedNodeCount": 3,
        "runHistoryId": "runhist_123"
      }
    },
    "error": {
      "message": "Node failed"
    },
    "tags": ["production"],
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:05:00.000Z",
    "startedAt": "2024-01-01T00:00:01.000Z",
    "finishedAt": "2024-01-01T00:05:00.000Z",
    "durationMs": 299000
  }
}

Error Responses

400 Bad Request

{
  "success": false,
  "error": "Invalid run ID"
}

This occurs when the run ID doesn't start with run_.

401 Unauthorized

{
  "success": false,
  "error": "Unauthorized",
  "message": "Authentication required"
}

404 Not Found

{
  "success": false,
  "error": "Run not found"
}

429 Too Many Requests

{
  "error": "Too many requests"
}

Example Requests

cURL

curl -X GET https://api.actionflows.ai/api/runs/run_123 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

JavaScript

const runId = 'run_123';

const response = await fetch(`https://api.actionflows.ai/api/runs/${runId}`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();

if (data.success) {
  const run = data.data;
  console.log('Run ID:', run.id);
  console.log('Status:', run.status);
  console.log('Duration:', run.durationMs, 'ms');
  
  if (run.status === 'COMPLETED') {
    console.log('Output:', run.output);
  } else if (run.status === 'FAILED') {
    console.error('Run failed');
  }
} else {
  console.error('Error:', data.error);
  
  if (response.status === 404) {
    console.error('Run not found');
  }
}

Python

import requests

headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
}

run_id = 'run_123'
response = requests.get(
    f'https://api.actionflows.ai/api/runs/{run_id}',
    headers=headers
)

data = response.json()

if data['success']:
    run = data['data']
    print(f"Run ID: {run['id']}")
    print(f"Status: {run['status']}")
    print(f"Duration: {run.get('durationMs', 'N/A')} ms")
    
    if run['status'] == 'COMPLETED':
        print(f"Output: {run.get('output', {})}")
    elif run['status'] == 'FAILED':
        print("Run failed")
else:
    print(f"Error: {data['error']}")
    
    if response.status_code == 404:
        print("Run not found")

Response Fields

FieldTypeDescription
idstringUnique run identifier (starts with run_)
statusstringRun status
payloadobjectPublic run payload
payload.organizationIdstringOrganization ID
payload.actionFlowIdstringFlow ID
payload.inputsobjectPer-run input overrides
payload.triggerSourcestringHow the run was started (api, webhook, schedule, …)
outputobjectRun output (if present)
errorobject{ message } when the run failed
tagsarrayCaller tags (organization ownership tags are omitted)
createdAtstring (ISO 8601)Run creation timestamp
updatedAtstring (ISO 8601)Last update timestamp
startedAtstring (ISO 8601)Run start timestamp
finishedAtstring (ISO 8601)Run finish timestamp (if finished)
durationMsnumberRun duration in milliseconds (if finished)
metadataobjectSafe ActionFlow execution progress; internal runtime metadata is omitted
metadata.activeNodeIdstringNode currently executing (if present)
metadata.failedNodeIdstringNode that failed (if present)
metadata.executedNodesnon-negative integerNumber of nodes executed so far
metadata.totalNodesnon-negative integerTotal executable node count
metadata.statusstringActionFlow execution phase

Run Status Values

  • COMPLETED - Run finished successfully
  • FAILED - Run failed with an error
  • CANCELED - Run was canceled
  • CRASHED - Run crashed unexpectedly
  • TIMED_OUT - Run exceeded time limit
  • WAITING - Run is waiting to start
  • EXECUTING - Run is currently executing
  • PAUSED - Run is paused

Notes

  • Run IDs must start with run_
  • The output field is only available for completed runs
  • The durationMs field is only available for completed runs
  • Internal runtime fields, including machine sizing, cost, task version, and unsanitized metadata, are not returned
  • Use the Stream Run endpoint for real-time updates
  • This endpoint is rate-limited per user

On this page