Per-workflow CI health over a window (default last 24 hours, maximum 366 days): run count, success rate, p50/p95 duration, last failure time, latest-run status, and a zero-filled run history bucketed by hour/day/week to fit the window. Success rate covers runs that succeeded or ended in a decisive failure. Skipped, cancelled, neutral, and action-required runs are excluded. p50/p95 are over successful runs only, so cancelled (superseded) and failed runs never bias the duration trend. Runs under 10 seconds that did no work are excluded when longer successful runs exist. An all-fast workflow uses every successful run. Optionally scope to a single git branch via branch, to one workflow via workflow_name, or to one run group via run_scope (default_branch, pull_request, merge_queue). Use this for 'is CI getting slower' and 'which workflow is the long pole'; compare two windows to get a trend.
Request
- Base URL: https://us.posthog.com
- URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/workflow_health/
- Auth: HTTP bearer
Path parameters
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
Optional exact git branch (head_branch) to scope results to, e.g. 'main'. Omit or leave blank to aggregate across all branches.
Window start: relative ('-24h', '-7d') or ISO8601. Defaults to -24h.
Window end: relative or ISO8601. Defaults to now.
'owner/name' repository to scope to when the selected source syncs several repositories (from the sources list). Defaults to the source's first repository.
Which group of runs to report on: 'all' (default) is every run; 'default_branch' is runs on master or main; 'pull_request' is runs on PR branches, excluding default-branch and merge-queue runs; 'merge_queue' is the gate runs the merge queue fired before a merge landed. Fork PRs carry no PR attribution (a GitHub limitation), so they appear only under 'all'. Any other value is a 400.
Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.
Optional exact workflow name to scope results to, e.g. 'Backend CI'. Omit to rank every workflow. Pass it when you want one workflow's figures over the whole window rather than the top slice.
Response
Changes
No recorded changes to this operation across all 1 revision of this API.