GoRunner docs
Search or askSearch⌘K

Cancel a run

POST/api/runs/{id}/cancel

Asks a queued, running or held run to stop.

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

Parameters

Path

idRequired · UUID

The run’s ID.

Read the answer

statuscancelledWhat happened
cancellingtrueAsked. A running step finishes unwinding, then the run is cancelled. Ask Get a run until it is.
cancelledtrueA held run, settled at once.
Its finished statusfalseIt had already finished. Nothing was done; don’t retry.

A queued run is settled at once, even though the answer says cancelling. It takes no body.

Responses

  • 200OK

    Always 200. Read status and cancelled to see what happened.

  • id isn’t a UUID.

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

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

  • The stop couldn’t be signalled, or a held run couldn’t be settled. Try again.

  • This installation has no Redis, so a cancel can’t be signalled.

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
RUN_ID="your-run-id"

curl -X POST "$GORUNNER/api/runs/$RUN_ID/cancel" \
  -H "Authorization: Bearer $GORUNNER_TOKEN"

Response · 200 OK

json
{
  "data": {
    "id": "8f0c41d2-6b7e-4c1a-9d3f-2a5b7c9e1f04",
    "status": "cancelling",
    "cancelled": true
  }
}
Every field

It takes no body.

Response · 200 OK

dataobject

The outcome of a cancel request. cancelled: false means nothing was done because the run had already settled.

idUUID

The run id.

statusstring

cancelling = the request was signalled to the executor and the run is NOT yet terminal (poll GET /api/runs/{id}). cancelled = a paused run was settled here and now. Any other value is the status the run had ALREADY settled at, returned with cancelled: false.

One of cancelling, cancelled, completed, failed, pending, running, paused.

cancelledboolean

true when a cancellation was requested or performed; false when the run was already terminal and nothing happened.