Cancel a run
POST/
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 · UUIDThe run’s ID.
Read the answer
| status | cancelled | What happened |
|---|---|---|
cancelling | true | Asked. A running step finishes unwinding, then the run is cancelled. Ask Get a run until it is. |
cancelled | true | A held run, settled at once. |
| Its finished status | false | It 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
statusandcancelledto see what happened. idisn’t a UUID.- 403
FORBIDDENThe token lacks the Cancel and delete permission for runs.
- 404
NOT_FOUNDNo 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.
- 503
UNAVAILABLEThis 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"const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;
const RUN_ID = process.env.RUN_ID;
const res = await fetch(
`${GORUNNER}/api/runs/${RUN_ID}/cancel`,
{
method: "POST",
headers: { Authorization: `Bearer ${TOKEN}` },
},
);
const { data } = await res.json();import os, requests
GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]
RUN_ID = os.environ["RUN_ID"]
res = requests.post(
f"{GORUNNER}/api/runs/{RUN_ID}/cancel",
headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]Response · 200 OK
{
"data": {
"id": "8f0c41d2-6b7e-4c1a-9d3f-2a5b7c9e1f04",
"status": "cancelling",
"cancelled": true
}
}Every field
It takes no body.
Response · 200 OK
dataobjectThe outcome of a cancel request.
cancelled: falsemeans nothing was done because the run had already settled.idUUIDThe run id.
statusstringcancelling= the request was signalled to the executor and the run is NOT yet terminal (pollGET /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 withcancelled: false.One of
cancelling,cancelled,completed,failed,pending,running,paused.cancelledbooleantruewhen a cancellation was requested or performed;falsewhen the run was already terminal and nothing happened.