GoRunner docs
Search or askSearch⌘K

Cancel waiting runs

Since v2026.10.6

POST/api/workflows/{id}/runs/cancel-waiting

Cancels all of a workflow’s runs waiting in line, in one step.

Needs an API token with the Cancel and delete permission for runs (run:manage).

Parameters

Path

idRequired · UUID

The workflow’s ID.

What it takes, and what it leaves

It takes production and test runs that haven’t started. Each becomes cancelled with the error “Cancelled by user” and no duration.

Runs that started are left: running, held, or carrying on after an answer. Cancel them one by one. A run a worker takes at that moment is either cancelled or runs, never both.

The audit log gets one run.cancel row with the count, or none when nothing waited. It takes no body.

Responses

  • 200OK

    How many were cancelled; 0 when none waited.

  • id isn’t a UUID.

  • The token lacks the Cancel and delete permission for runs.

  • No workflow with this ID in the token’s workspace.

  • Nothing was cancelled. Try again.

Any call can also answer: 401 UNAUTHORIZED · 401 TOKEN_ENDED · 403 TOKEN_SURFACE_OFF · 403 FEATURE_OFF · 403 EMBED_NOT_ALLOWED · 403 EMBED_NOT_AVAILABLE · 403 ACCOUNT_SUSPENDED · 413 PAYLOAD_TOO_LARGE · 415 INVALID_CONTENT_TYPE · 429 RATE_LIMITED · 503 BUSY · 503 PAUSED · 503 SERVICE_UNAVAILABLE. See Errors.

Request

GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…"  # needs Cancel and delete for runs
WORKFLOW_ID="your-workflow-id"

URL="$GORUNNER/api/workflows/$WORKFLOW_ID/runs/"
URL="${URL}cancel-waiting"
curl -X POST "$URL" \
  -H "Authorization: Bearer $GORUNNER_TOKEN"

Response · 200 OK

json
{
  "data": {
    "cancelled": 5
  }
}
Every field

It takes no body.

Response · 200 OK

dataobject
cancelledinteger

The runs this call took out of the line and settled cancelled.