Automations

Get automation run stats

Changed on

Returns aggregate run counts (total + completed) and a per-day breakdown across all of the org automations, over the last windowDays UTC calendar days including today. completed counts every run that reached a terminal status, failed runs included. At most 5,000 run records are counted, so a busy organization can see an undercount.

get/api/v0/automations/run-stats

Request

  • Base URL
    https://api.factory.ai
  • Auth
    HTTP bearer

Query parameters

windowDays, string

Days of history to aggregate, ending today (1-90, default 7). Larger values are clamped to 90, fractions are rounded down, and a value that is not a positive number uses 7.

Headers

X-Factory-Org-Id, string

Organization a JWT request acts in; required to act in a sub-organization. Without it, the request acts in the user's root organization, or is rejected with 403 when the user cannot access the root organization. API keys always act in their own organization and ignore this header.

Response

Response for status 200

GetAutomationRunStats200ResponseBody required
windowDays, number required
totalRuns, number required

Runs started in the window, counting at most 5,000 run records.

completedRuns, number required

Runs in totalRuns that reached a terminal status, failed runs included.

daily, object[] required

One bucket per UTC calendar day of the window, oldest first.

Changes