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
- Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
- Permissions: Ensure your token has permissions to view automations (admin role on the automation's repos).
- Automation ID (or Organization ID): Identify the automation — or the organization — whose metrics you want to read.
What executionMetrics returns
executionMetrics returnsexecutionMetrics 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.
| Field | Type | Description |
|---|---|---|
successRate | Float! | Fraction (0.0–1.0) of counted executions that finished successfully. 0 when there are none. |
failureRate | Float! | Fraction (0.0–1.0) of counted executions that failed. 0 when there are none. |
totalRuns | Int! | Number of finished/failed executions in the period. |
averageDuration | Float | Average execution duration in seconds. null when there are no counted executions. |
lastRun | DateTime | Finish timestamp of the most recent counted execution. null when there are none. |
The period argument
period argumentexecutionMetrics accepts an optional period argument that selects the time window. If omitted, it defaults to SIXTY_MINUTES.
| Value | Window |
|---|---|
FIFTEEN_MINUTES | Last 15 minutes |
SIXTY_MINUTES | Last 60 minutes (default) |
TWELVE_HOURS | Last 12 hours |
TWENTY_FOUR_HOURS | Last 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
automationsquery is paginated. When you request more automations than fit on one page, read the remaining pages usingfirst/aftercursors. See our Pagination basics page. The optionalautomationIdsfilter 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.

