Actions REST API: listWorkflowRuns returns stale results (sometimes weeks old) on high-volume repos #206725
Replies: 17 comments 6 replies
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Hi, The behavior you described does look more like an API-side consistency issue than a problem with the One thing I’d try as a diagnostic is to constrain the request with For production tooling, I’d also avoid assuming that the first item from a single broad query is always the definitive latest successful run. If an older run would be dangerous as a comparison base, validating the returned run before using it and retrying when the result is inconsistent would be a safer approach. Given that you have a reproducible example with full request/response logging and a large discrepancy in |
|
We've started encountering this problem as well starting yesterday and twice today. We've relied on this API returning accurate results for years without issue (preventing costly rebuilds and only rebuilding what changed since the previous successful job run). Yesterday (around 2026-09-01T23:59Z) instead of returning a |
This comment was marked as low quality.
This comment was marked as low quality.
|
We are experiencing the same issues since a few days: but every now and then it we get Note how the "latest" run is suddenly over a month ago instead of a few hours. We've notified GitHub Support. |
|
This seems to be related to stale/inconsistent results from the The same request can return different results, sometimes showing workflow runs from weeks ago, and even the Using github.rest.actions.listWorkflowRuns({
owner,
repo,
workflow_id,
head_sha: commitSha,
});However, querying every commit individually is not practical when trying to find the latest workflow run. Is there a recommended way to reliably get the latest workflow run without using |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Hi, I am experiencing the same issue via the use of https://github.com/dawidd6/action-download-artifact which clearly assumes the returned workflows are returned the most recent runs first. The parameters of the action are:
Which leads to As one stated above, it seems to happen more frequently when queried from GitHub actions. When the API is invoked with |
|
We independently reproduced this with sequential requests using Node’s built-in HTTPS client, outside GitHub Actions and without CLI pagination or application caching. Identical first-page requests intermittently returned weeks-old history and substantially different |
Actions API returns an old successful-run page while a newer eligible run existsWe independently captured this during a production workflow on September 18, 2026. This corroborates https://github.com/orgs/community/discussions/206725. Request pattern: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs The request filtered by branch, event=push, and status=success, with the default first page (30 results). We recorded the actual response consumed by the workflow, before candidate validation. At 2026-09-18 19:18:54 UTC, GitHub returned HTTP 200 and total_count=2344. All 30 returned runs were dated September 3–5; the first run was created September 5 at 07:49:48 UTC. An eligible push in the same workflow and branch had already completed successfully on September 18 at 19:09:46 UTC, but was absent. Its individual run record confirmed the matching workflow, branch, event, SHA and successful conclusion. Expected: the first page should contain the recent eligible run rather than omit it in favor of a result set almost two weeks old. Impact: our baseline selector rejected all 30 old candidates and fell back to the previous commit. That previous commit happened to have deployed successfully in this occurrence, so no missing delivery was established. The same fallback can be unsafe when the previous deployment failed. An older incident instead selected an old successful ancestor and widened the deployment range. The response itself establishes the missing recent result; it does not establish GitHub's internal caching or indexing cause. We have the response timestamp, x-github-request-id, candidate metadata and matching newer run details available for GitHub Support privately. Repository identifiers, run IDs and commit SHAs are intentionally omitted from this public summary. Please investigate consistency of the workflow-run listing endpoint and confirm whether this is a known incident. This is not a request to rerun production workloads. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
this happens every time with manual runs for me |
|
same here, we have to execute our jobs multiple times to get the right data |
|
Same here. The API has worked reliably for years, until now ! During a scheduled run, the API started returning weeks old run today instead of the newest one (with per_page 1), and breaking our workflows. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
API
Body
Describe the bug
GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs(and the repo-wideGET /repos/{owner}/{repo}/actions/runsvariant) intermittently returns a stale result set on arepository with a high volume of workflow runs. The same exact query, called seconds to minutes
apart with no other change, returns a materially different "most recent" run and a different
total_count, with the stale response sometimes landing weeks behind the true most recent run.This reproduces both with and without the
statusfilter, so it isn't specific to that parameter.Steps to reproduce
many pushes a day, call:
GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs?branch={branch}&event=push&status=success&per_page=1total_countandworkflow_runs[0].head_sha/created_atbetween the two responses.Note: this seems to happen a LOT more frequently when run in GitHub actions, e.g. via
github-scriptinvoking:Actual behavior
Observed both of the following independently:
total_count: 1942with thetop run dated ~3 weeks old, then
total_count: 4265with the top run dated seconds ago. No newworkflow runs could plausibly account for that count jump in that time window.
actions/github-script/@octokit/plugin-paginate-rest, with full HTTP debug logging enabled) and picked a specific commitas "the most recent successful run" that was in fact ~3.5 weeks and several hundred commits behind
the actual most recent successful run on that branch at that exact moment. Re-running the identical
query moments later, and a time-bounded reconstruction using the
createdfilter to pin the exactsame instant, both showed the true most recent successful run should have been returned instead.
This occurred both with
status=successset and with it omitted (filtering client-side onconclusioninstead), so dropping that particular filter is not a workaround.Expected behavior
The endpoint should reflect the actual current state of workflow runs.
The endpoint should NOT return data that is stale by several weeks.
Impact
This endpoint is a documented, commonly recommended way to find "the last successful run on a branch"
for CI/CD tooling. On a busy repo, staleness of this magnitude causes CI to silently use a wildly
outdated comparison base, with no error surfaced, since the query itself returns a normal-looking
(but stale) 200 response.
Additional context
All reactions