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",
    "taskIdentifier": "run-flow",
    "version": "1.0.0",
    "payload": {
      "organizationId": "org_123",
      "actionFlowId": "flow_123",
      "data": {
        "customerEmail": "[email protected]"
      }
    },
    "output": {
      "result": "Flow completed successfully"
    },
    "tags": ["production"],
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:05:00.000Z",
    "startedAt": "2024-01-01T00:00:01.000Z",
    "completedAt": "2024-01-01T00:05:00.000Z",
    "duration": 299
  }
}

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.duration, 'seconds');
  
  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('duration', 'N/A')} seconds")
    
    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
taskIdentifierstringTask identifier
versionstringRun version
payloadobjectOriginal run payload
payload.organizationIdstringOrganization ID
payload.actionFlowIdstringFlow ID
payload.dataobjectCustom data passed to the flow
outputobjectRun output (if completed)
tagsarrayRun tags
createdAtstring (ISO 8601)Run creation timestamp
updatedAtstring (ISO 8601)Last update timestamp
startedAtstring (ISO 8601)Run start timestamp
completedAtstring (ISO 8601)Run completion timestamp (if completed)
durationnumberRun duration in seconds (if completed)

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 duration field is only available for completed runs
  • Use the Stream Run endpoint for real-time updates
  • This endpoint is rate-limited per user

On this page