Connectors

/

GitHub

/

Cancel stuck GitHub workflow runs
Write

Clear stuck GitHub Actions runs without cancelling a deploy

For developers whose runners are tied up by old queued runs, who want them cleared safely by asking their AI assistant.

Try PopdockAI free
Get a live demo
Cancel stuck GitHub workflow runs
Find GitHub Actions runs in contoso/web that have been stuck for more than 6 hours.
3 runs in contoso/web have been queued or in progress for over 6 hours. - Run 4812: CI on feature/search, superseded by a newer run - Run 4809: CI on main, queued 9 hours - Run 4801: Deploy production, in progress 7 hours, a deploy Which runs should I cancel? By default none are.
GitHub
Sample figures. Your results come from your own account.
github-get-workflow-run
github-cancel-workflow-run

On this page

The problem

The problem

The prompt

Who it's for

How it works

Tools used

Connector

GitHub

GitHub
Run it on your own GitHub data.

Connect GitHub, pick your AI tool and paste the prompt.

Try PopdockAI free

The problem

Stuck runs hold runners and block later builds

GitHub Actions runs get stuck queued or in progress for hours, holding runners and blocking later builds. Clearing them means finding the old ones, checking if a newer run replaced each, and cancelling them one by one.

Without PopdockAI

  • Scroll the Actions tab for old queued runs
  • Check each for a newer run on the same branch
  • Work out which ones are deploys
  • Cancel them one by one and hope

With PopdockAI

  • Runs queued or running longer than your threshold are listed
  • Runs replaced by a newer run are marked
  • Deploy and release workflows are pointed out before you choose
  • Only runs you approve are cancelled, then re read

The prompt

Use this prompt

Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.

Prompt
**Objective:** Find the GitHub Actions runs in `{repository}` that have been queued or in progress for more than `{stale-hours}` hours (default 6), and cancel the ones the user approves.

**Step 1: Find the candidates**

Call `github-get-workflow-run` with company `{repository}` and status `queued`, then again with status `in_progress`. Keep only runs whose created-date is more than the threshold ago.

**Step 2: Check each one**

For each candidate, check whether a newer run of the same workflow name on the same branch exists. A superseded stuck run is the safest to cancel; say so.

**Step 3: Confirm**

Show a table: workflow name, run-number, branch, status, hours since created-date, superseded yes or no, url. Ask the user which runs to cancel. Default to none.

**Step 4: Cancel**

For each approved run, call `github-cancel-workflow-run` once, passing its workflow-run-id as run-id. Then re-read with `github-get-workflow-run` and report each run's final status.

**Rules & Guidelines:**

* Never cancel a run the user did not explicitly approve.
* Do NOT call `github-rerun-workflow-run`, `github-disable-workflow` or `github-enable-workflow`.
* Deployment workflows can be long-running on purpose; if a workflow name suggests a deploy or release, point that out before asking.

**Validation:**

* If no runs exceed the threshold, say so and stop.
* If a cancel fails, report it and carry on with the rest.

Who it's for

One answer, three teams that use it

DevOps engineers

Free up runners safely

Superseded runs are marked so you can cancel the ones that no longer matter.

Which GitHub Actions runs in fabrikam/api have been queued for over 3 hours?

Developers

Unblock your build

See what is clogging the queue and cancel only the runs you pick.

Find stuck runs in contoso/mobile older than 2 hours and let me choose which to cancel.

Release managers

Avoid cancelling a deploy by mistake

Long running deploy and release workflows are called out before anything is cancelled.

List runs stuck for over 12 hours in northwind/platform and flag any deploys.

How it works

What PopdockAI does when you ask

You name the repository and an age threshold, and your AI assistant lists the stuck runs with context. Nothing is cancelled unless you explicitly approve it.

01

Ask

You name the repository and an age threshold.

Your AI tool

02

Find

It lists runs queued or in progress longer than that.

github-get-workflow-run

03

Check

It marks runs a newer run replaced and points out deploy or release workflows.

github-get-workflow-run

04

Confirm

You approve specific runs, and each is cancelled once and re-read.

Your AI tool

What PopdockAI provides

The tools behind the answer

Ready made tools for GitHub and one secure connection to your AI tool. No code, no exports.

get-data

github-get-workflow-run

Returns GitHub Actions workflow runs with their status and conclusion. Filter by workflow name, run number, branch, triggering event, status, conclusion and created date range.
run-action

github-cancel-workflow-run

Cancels a GitHub Actions workflow run that is queued or in progress, identified by run ID.
Read only.Nothing in GitHub Changes

This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.

How Popdock AI secures your data

The outcome

Stuck runs cleared, deploys protected

Try PopdockAI free
Get a live demo

Related use cases

More ways to put this data to work

All Ramp use cases

One prompt template with infinite possibilities.

‍

Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.

Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

Try PopdockAI Free
See Documentation