Skip to main content

List Flow Runs

List all runs for a specific ActionFlow via the REST API, with optional filtering and pagination. Includes parameters and response schema.

List Flow Runs

Retrieve run history for a specific ActionFlow from Postgres, with optional filtering and cursor pagination.

Endpoint

GET /api/actionflows/{actionFlowId}/runs

Try it

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

get/api/actionflows/{actionFlowId}/runs

List runs for a flow

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

curl -X GET 'https://api.actionflows.ai/api/actionflows/{actionFlowId}/runs' \
  -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
flowIdstringYesThe unique identifier of the flow

Query Parameters

Pagination

ParameterTypeRequiredDescription
page[size]numberNoNumber of results per page
page[after]stringNoCursor for pagination (get results after this cursor)
page[before]stringNoCursor for pagination (get results before this cursor)

Filters

ParameterTypeRequiredDescription
filter[status]stringNoFilter by run status. Comma-separated values: COMPLETED, FAILED, CANCELED, CRASHED, TIMED_OUT, WAITING, EXECUTING, PAUSED
filter[tag]stringNoFilter by tags. Comma-separated values
filter[createdAt][from]string (ISO 8601)NoFilter runs created after this date
filter[createdAt][to]string (ISO 8601)NoFilter runs created before this date
filter[createdAt][period]stringNoFilter by time period (for example, today, week, month)
filter[isTest]booleanNoFilter test runs (true or false)

Response

Success Response (200 OK)

{
  "success": true,
  "data": {
    "data": [
      {
        "id": "run_123",
        "status": "COMPLETED",
        "taskIdentifier": "run-flow",
        "payload": {
          "organizationId": "org_123",
          "actionFlowId": "flow_123"
        },
        "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"
      }
    ],
    "pagination": {
      "next": "cursor_123",
      "prev": "cursor_456"
    }
  }
}

Error Responses

400 Bad Request

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

401 Unauthorized

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

403 Forbidden

{
  "success": false,
  "error": "Unauthorized",
  "message": "Organization access denied"
}

404 Not Found

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

Example Requests

Get All Runs for a Flow

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

Get Runs with Filters

curl -X GET "https://api.actionflows.ai/api/actionflows/flow_123/runs?filter[status]=COMPLETED,FAILED&filter[isTest]=false&page[size]=10" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

JavaScript

const flowId = 'flow_123';

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

const data = await response.json();

if (data.success) {
  const runs = data.data.data;
  console.log(`Found ${runs.length} runs`);
  
  // Get completed runs only
  const params = new URLSearchParams({
    'filter[status]': 'COMPLETED',
    'filter[isTest]': 'false',
    'page[size]': '20',
  });
  
  const filteredResponse = await fetch(
    `https://api.actionflows.ai/api/actionflows/${actionFlowId}/runs?${params}`,
    {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
    }
  );
  
  const filteredData = await filteredResponse.json();
}

Python

import requests
from urllib.parse import urlencode

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

flow_id = 'flow_123'

# Get all runs
response = requests.get(
    f'https://api.actionflows.ai/api/actionflows/{flow_id}/runs',
    headers=headers
)

data = response.json()

if data['success']:
    runs = data['data']['data']
    print(f"Found {len(runs)} runs")
    
    # Get completed runs with filters
    params = {
        'filter[status]': 'COMPLETED,FAILED',
        'filter[isTest]': 'false',
        'page[size]': '20',
    }
    
    filtered_response = requests.get(
        f'https://api.actionflows.ai/api/actionflows/{flow_id}/runs',
        headers=headers,
        params=params
    )
    
    filtered_data = filtered_response.json()

Response Fields

FieldTypeDescription
dataarrayArray of run objects
data[].idstringUnique run identifier (starts with run_)
data[].statusstringRun status
data[].taskIdentifierstringTask identifier
data[].payloadobjectRun payload including organizationId and actionFlowId
data[].tagsarrayRun tags
data[].createdAtstring (ISO 8601)Run creation timestamp
data[].updatedAtstring (ISO 8601)Last update timestamp
data[].startedAtstring (ISO 8601)Run start timestamp
data[].completedAtstring (ISO 8601)Run completion timestamp (if completed)
paginationobjectPagination information
pagination.nextstringCursor for next page
pagination.prevstringCursor for previous page

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

  • Only runs for the specified flow are returned
  • Runs are filtered by the flow's organizationId and actionFlowId
  • Use pagination for large result sets
  • Multiple status values can be specified by comma-separating them
  • Multiple tags can be specified by comma-separating them

On this page