---
title: "Get workflow stats"
method: GET
path: "/api/apps/{app_id}/workflows/stats"
---

# Get workflow stats

`GET /api/apps/{app_id}/workflows/stats`

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Counts each workflow's runs over a time window, for a health view.

One row per workflow that ran in the window, with how many runs finished, failed, or were cancelled, and how long they took on average. A workflow with no runs in the window does not appear.

The window defaults to the last 24 hours. Set `since` and `until` to choose your own. A window longer than 30 days is not rejected: `since` is moved forward so the window ends at `until` and covers the 30 days before it, and nothing in the response says that happened. Ask for at most 30 days if you need the range you sent to be the range you get.

This endpoint is limited to 30 requests per minute.

## Path parameters

- `app_id` string, required — ID of the app whose workflows you want to work with.

## Query parameters

- `since` string, nullable — Start of the window, as an ISO 8601 datetime. Defaults to 24 hours ago.
- `until` string, nullable — End of the window, as an ISO 8601 datetime. Defaults to now.

## Response `200`

One row per workflow that ran in the window.

- WorkflowStatsRow[]
  - `workflow_id` string, required — ID of the workflow these counts belong to.
  - `total` integer, required — Runs that started in the window.
  - `completed` integer, required — Runs that finished successfully.
  - `failed` integer, required — Runs that ended in an error.
  - `cancelled` integer, required — Runs that were cancelled before finishing.
  - `avg_duration_ms` number, required — Mean wall-clock duration of the runs in the window, in milliseconds.
  - `last_run_at` string, nullable — When the most recent run in the window started, or `null` when none ran.
  - `last_run_status` string, required — Status of that most recent run. Empty when no run happened in the window.

## Other responses

- `400` — `since` or `until` is not an ISO 8601 datetime.
- `401` — Missing or invalid credentials.
- `403` — You don't have access to this app, the app does not exist, the app still runs the older automations engine instead of workflows, or you used a workspace API key. A missing app and an app you cannot reach are deliberately the same answer.
- `422` — Validation Error

---

[API](https://skmtc.dev/idealspot/apis/base44-app-management-api.md) · [All operations](https://skmtc.dev/idealspot/apis/base44-app-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/idealspot/base44-app-management-api/revisions/31ef75eb64ab/schema)
