GitHub Actions: cancelling a run that will not stop
Cancelling a workflow run asks GitHub to stop its jobs, but some jobs are allowed to go on, and the run can stay in progress for up to 5 minutes while the runners stop. When a run does not respond to a cancel, GitHub has a second request, force-cancel, which skips those conditions. A run stuck in Queued with no jobs is a different case: public reports from 2026 say both requests can fail there.
What Cancel does
GitHub's workflow cancellation reference lists the steps:
- GitHub evaluates the
ifcondition of every running job again. A job whose condition is true is not cancelled:if: always()is true, so that job keeps running. A job without a condition counts asif: success()and is cancelled. - The runners of the cancelled jobs get a cancellation message. In jobs that go on, the
ifof each unfinished step is evaluated again;cancelled()is true in a step from then on. - A step being cancelled gets
SIGINT/Ctrl-C, thenSIGTERM/Ctrl-Break if it has not exited after 7,500 ms, then its process tree is killed if it is still running 2,500 ms later. - After 5 minutes, GitHub stops every job and step marked for cancellation that is still running.
So a run you cancelled can still show in progress for a while, and a job meant for clean-up (if: always() or if: cancelled()) runs to its end. Give such a job a timeout-minutes if it must not run for long. For a job that should run after a failure but not after a cancel, GitHub's troubleshooting guide suggests if: ${{ !cancelled() }} instead of always().
Cancel, then force-cancel
On GitHub: open the run, then Cancel workflow at the top right. From a terminal (GitHub CLI):
gh run cancel RUN_ID gh run cancel RUN_ID --force
--force came with GitHub CLI 2.78.0 (August 2025, cli/cli#11513). The REST API has the same two requests; both answer 202 Accepted, or 409 Conflict when GitHub refuses:
curl -X POST -H "Authorization: Bearer <token>" \ https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/cancel curl -X POST -H "Authorization: Bearer <token>" \ https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/force-cancel
- Force-cancel "bypasses conditions that would otherwise cause a workflow execution to continue, such as an always() condition on a job." GitHub asks you to use it only when the run does not respond to the normal cancel (REST API; added in September 2023, changelog). It also skips your clean-up jobs.
- Both need a token with the
reposcope (classic) or, fine-grained, Actions read and write (GitHub's permissions table). Without it, the answer is HTTP 403 "Resource not accessible by personal access token".
Runs stuck in "Queued" with no jobs
Several public reports in GitHub's community forum describe runs that stay Queued with zero jobs, no runner and no log, and cannot be cancelled:
- The web page: "Failed to cancel workflow." Cancel and force-cancel with the API: HTTP 500
"message": "Failed to cancel workflow run"(#196717, May 2026; #203685, August 2026). - Force-cancel: HTTP 409 "Cannot cancel a workflow run that has not been queued yet." (#206436, September 2026), or for a re-run, "Cannot cancel a workflow re-run that has not yet queued." (#196717, August 2026).
- Deleting the run instead: HTTP 403 "Could not delete the workflow run." (#203685, #196717).
What the reporters did: disabled the workflow so that no new runs queue up behind it (gh workflow disable, or Disable workflow on the workflow's page), and checked the workflow's concurrency group, where a stuck run can hold later ones back. One reporter marked a GitHub Support ticket as the answer.
GitHub's troubleshooting guide now describes the same case: a run that stays queued or in progress after cancelling, with no jobs, "Failed to cancel workflow", or HTTP 500 or 409 from cancel and force-cancel, may be stuck in an abnormal state. Cancelling, force-cancel included, may not clear it, and with concurrency it can keep blocking later runs of its group. GitHub asks you to contact the GitHub Support portal to clear the run.
Cancel runs from IntelliJ IDEA
Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window. Cancel Run asks first, sends the normal cancel and reads the run again; a refusal with a reason (HTTP 409) is shown in GitHub's own words. It does not force-cancel: for a run that ignores the cancel, use gh run cancel --force. Reading is free; re-running, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).
GitHub and GitHub Actions are trademarks of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc. or JetBrains.
More: "Unable to retry this workflow run because it was created over a month ago" · Approving a deployment that is "Waiting" for review · GitHub Actions plugins for IntelliJ IDEA compared · 日本語