---
title: "Aggregate test run counts for a workspace (fast Spanner aggregation)"
method: GET
path: "/journeyRuns/workspace/{workspace_id}/aggregate"
tags: ["TestRun"]
---

# Aggregate test run counts for a workspace (fast Spanner aggregation)

`GET /journeyRuns/workspace/{workspace_id}/aggregate`

Returns total test runs, counts grouped by status, and the top failing
tests in the workspace. Optional filters: environment_id, application_id,
start_time range. Mirrors aggregateWorkspacePlanRuns at the test-run
level.

## Path parameters

- `workspace_id` string, required

## Query parameters

- `environment_id` string
- `application_id` string
- `min_start_time` integer
- `max_start_time` integer
- `top_tests_limit` integer

## Response `200`

Aggregated workspace test run statistics

- TestRunWorkspaceAggregateResult — Fast aggregate over test runs for a workspace and optional filters
  - `total_test_runs` integer, required
  - `counts_by_status` TestRunWorkspaceNormalizedStatusCounts, required — Normalized status bucket counts for workspace test runs
    - `passed` integer — count of test runs with status COMPLETED (passed)
    - `failed` integer — count of test runs with status FAILED
    - `terminated` integer — count of test runs with status TERMINATED
    - `running` integer — count of in-flight test runs — folds all non-terminal statuses (running, queued, awaiting_precondition, rate_limited, terminating) into one bucket.
    - `skipped` integer — count of test runs with status SKIPPED
  - `scan_complete` boolean, required — True when aggregate counts cover the full filter (always true for this endpoint)
  - `top_tests_by_failed_runs` TestRunWorkspaceTopFailingTestEntry[], required
    - `journey_invariant_id` string, required — The test's invariant id (without variant suffix)
    - `test_name` string, required — Human-readable test name.
    - `failed_run_count` integer, required — Failed test-run count for this test in the requested time range
  - `top_tests_exhaustive` boolean, required — True when every failing test in range contributed to top_tests_by_failed_runs (no top-N truncation occurred)

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
