engineering_analytics
engineering_analytics

Runs of a single workflow within a repo over a window (date_from default -30d), newest first. Optionally scope to a single git branch via branch or to one run group via run_scope. Each row is run-level: per-job and per-step detail are not tracked yet. Use this as the GitHub 'workflow' page between the workflow list and a single run.

get/api/projects/{project_id}/engineering_analytics/workflow_runs/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/workflow_runs/
  • Auth: HTTP bearer

Path parameters

project_idstring required

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

branchstring

Optional exact git branch (head_branch) to scope results to, e.g. 'main'. Omit or leave blank to aggregate across all branches.

date_fromstring

Window start: relative ('-30d', '-8w') or ISO8601. Defaults to -30d.

date_tostring

Window end: relative or ISO8601. Defaults to now.

repostring required

'owner/name' repository the workflow belongs to.

run_scope'all' | 'default_branch' | 'merge_queue' | 'pull_request'

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.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.

workflow_namestring required

Workflow name to list runs for.

Response

idinteger required

Integer run id; unique only together with ci_engine.

workflow_namestring required

CI workflow name.

head_shastring required

Commit SHA the run was triggered on.

head_branchstring required

Git branch the run was triggered on.

statusstring required

Raw run status: 'queued', 'in_progress', 'completed', etc.

conclusionstring nullable required

Run conclusion ('success', 'failure', 'timed_out', 'cancelled', 'skipped', 'action_required', ...), or null while still in progress.

run_started_atstring date-time nullable required

When the run started, or null for a queued/barely-started run.

updated_atstring date-time nullable required

When the run was last updated (its finish time once completed), or null when unstarted.

duration_secondsinteger nullable required

Wall-clock duration in seconds; null until the run completes.

run_attemptinteger required

Re-run attempt number; 1 for the first attempt.

pr_numberinteger required

Pull request this run ran for, from the run's own-repo PR association; 0 when unattributed (a default-branch push, or a fork PR).

commit_pr_numberinteger nullable required

Pull request whose merge produced this run's head commit, resolved through the merged pull request's merge commit and falling back to the commit subject's '(#NNNN)' suffix. Null when neither resolves. The only PR attribution a default-branch push has: read pr_number first and fall back to this.

is_merge_queueboolean required

True when a merge queue pushed this run to gate pr_number, rather than the author pushing it. Count it when measuring CI; drop it when counting what the author did.

native_run_idstring nullable

Source-native run id; use with ci_engine for identity.

native_workflow_run_idstring nullable

Source-native workflow run id; use with ci_engine for identity.

workflow_idinteger nullable

GitHub's numeric id of the workflow. It stays the same when the workflow is renamed, so use it to follow one workflow over time. Null for a Depot CI run, and for a run whose source does not carry the id.

eventstring nullable

Event that triggered the run, such as 'push', 'pull_request' or 'schedule'. Null when unknown, as for a Depot CI run.

Changes

No recorded changes to this operation across all 1 revision of this API.