Automation Execution Metrics

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: Ensure your token has permissions to view automations (admin role on the automation's repos).
  3. Automation ID (or Organization ID): Identify the automation — or the organization — whose metrics you want to read.

What executionMetrics returns

executionMetrics is a field available on every Automation. It returns aggregated health metrics about how the automation has been executing over a recent time window. The metrics are calculated only from finished executions (executions that ended as failed or finished), and the time window is evaluated over each execution's last-updated timestamp.

FieldTypeDescription
successRateFloat!Fraction (0.0–1.0) of counted executions that finished successfully. 0 when there are none.
failureRateFloat!Fraction (0.0–1.0) of counted executions that failed. 0 when there are none.
totalRunsInt!Number of finished/failed executions in the period.
averageDurationFloatAverage execution duration in seconds. null when there are no counted executions.
lastRunDateTimeFinish timestamp of the most recent counted execution. null when there are none.

The period argument

executionMetrics accepts an optional period argument that selects the time window. If omitted, it defaults to SIXTY_MINUTES.

ValueWindow
FIFTEEN_MINUTESLast 15 minutes
SIXTY_MINUTESLast 60 minutes (default)
TWELVE_HOURSLast 12 hours
TWENTY_FOUR_HOURSLast 24 hours

Step 1: Metrics for a single automation

Use the automation query and select executionMetrics on the returned automation:

{
  automation(id: "123") {
    id
    name
    executionMetrics(period: SIXTY_MINUTES) {
      successRate
      failureRate
      totalRuns
      averageDuration
      lastRun
    }
  }
}

Step 2: Metrics for many automations

Because executionMetrics lives on the Automation type, it is also available on every node of the automations query. This lets you read metrics for several automations at once:

{
  automations(organizationId: "321", automationIds: ["123", "456"]) {
    edges {
      node {
        id
        name
        executionMetrics(period: TWENTY_FOUR_HOURS) {
          successRate
          failureRate
          totalRuns
          averageDuration
          lastRun
        }
      }
    }
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

ℹ️

The automations query is paginated. When you request more automations than fit on one page, read the remaining pages using first/after cursors. See our Pagination basics page. The optional automationIds filter is described in Retrieve Automations.

Step 3: Execute and Interpret the Response

After running the single-automation query, you'll receive a structured JSON response. Here's an example:

{
  "data": {
    "automation": {
      "id": "123",
      "name": "First automation",
      "executionMetrics": {
        "successRate": 0.95,
        "failureRate": 0.05,
        "totalRuns": 20,
        "averageDuration": 4.3,
        "lastRun": "2026-06-23T14:21:08Z"
      }
    }
  }
}

How the metrics are calculated

For the selected period, only executions matching all of the following are counted:

  • the execution ended as failed or finished;
  • the execution has a finish timestamp set;
  • the execution was last updated within the period.

From that set: successRate and failureRate are the share of finished vs. failed executions, totalRuns is the count, averageDuration is the average time between an execution's start and finish (in seconds), and lastRun is the most recent finish timestamp.

This field provides a quick way to monitor the operational health of one automation or a set of automations.