provider engineering_analyticsengineering_analytics GET /api/projects/{project_id}/engineering_analytics/workflow_health/
@utdk/posthog /api/projects/{project_id}/engineering_analytics/workflow_health/
engineering_analytics_workflow_health
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. p50/p95 are over successful runs only, so cancelled (superseded) and failed runs never bias the duration trend. Optionally scope to a single git branch via `branch`, or to attributed pull-request runs via `run_scope=pull_request`. Use this for 'is CI getting slower' and 'which workflow is the long pole'; compare two windows to get a trend.
branch query
Optional exact git branch (head_branch) to scope results to, e.g. 'main'. Omit or leave blank to aggregate across all branches.
string
date_from query
Window start: relative ('-24h', '-7d') or ISO8601. Defaults to -24h.
string
date_to query
Window end: relative or ISO8601. Defaults to now.
string
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string
run_scope query
Run scope for workflow health: 'all' (default) includes every run; 'pull_request' includes runs attributed to pull requests, excluding default-branch (master/main) runs. Fork PRs carry no PR attribution (a GitHub limitation), so 'pull_request' covers same-repo PRs only. Any other value is a 400.
enum: all, pull_request
source_id query
Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.
string

Try it

Authentication
Configure credentials for PostHog API
engineeringAnalyticsWorkflowHealth
GET/api/projects/{project_id}/engineering_analytics/workflow_health/
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. p50/p95 are over successful runs only, so cancelled (superseded) and failed runs never bias the duration trend. Optionally scope to a single git branch via `branch`, or to attributed pull-request runs via `run_scope=pull_request`. Use this for 'is CI getting slower' and 'which workflow is the long pole'; compare two windows to get a trend.

Parameters

required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

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.

Run scope for workflow health: 'all' (default) includes every run; 'pull_request' includes runs attributed to pull requests, excluding default-branch (master/main) runs. Fork PRs carry no PR attribution (a GitHub limitation), so 'pull_request' covers same-repo PRs only. 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.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.engineeringAnalyticsWorkflowHealth()