Runs in flight
GET/
The runs of your workspace that haven’t finished yet, by state. It takes no parameters.
Needs an API token with the Read permission for runs (run:read).
Response
runs counts the runs that haven’t finished: pending (queued), running and paused. Every key is always there, zero included.
waiting is the pending runs that wait in line for a free slot. They are counted in pending too, so don’t add waiting to the others.
The answer also holds queue and keel, always {"available": false}. They are leaving: don’t read them. The installation’s queue depths are on the Health page of the Platform console, for its admins.
For figures by day, or under the Runs page’s filters, use Count runs by state.
Request
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…" # needs Read for runs
curl "$GORUNNER/api/stats" \
-H "Authorization: Bearer $GORUNNER_TOKEN"const res = await fetch(`${GORUNNER}/api/stats`, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await res.json(); // data.runsres = requests.get(
f"{GORUNNER}/api/stats",
headers={"Authorization": f"Bearer {TOKEN}"},
)
runs = res.json()["data"]["runs"]Response · 200 OK
{
"data": {
"runs": {
"pending": 0,
"running": 0,
"paused": 0,
"waiting": 0
}
}
}Responses
- 200OK
The workspace’s runs in flight.
- 403
FORBIDDENThe token lacks the Read permission for runs.
The counts couldn’t be read. Try again.
Any call can also answer: 401 UNAUTHORIZED · 401 TOKEN_ENDED · 403 TOKEN_SURFACE_OFF · 429 RATE_LIMITED · 503 PAUSED · 503 SERVICE_UNAVAILABLE. See Errors.
Every field
It takes no body.
Response · 200 OK
dataobjectThe caller’s workspace’s in-flight run counts.
runsobjectNon-terminal runs in the caller’s workspace. All four keys are always present.
pendingintegerNot finished and not paused: waiting in line or executing (includes
waiting).waitingintegerOf
pending, the runs waiting in line for a free slot (a runs-at-once limit or a free worker).runningintegerCurrently executing.
pausedintegerSuspended on a durable wait.
queueobjectAlways
{"available": false}. Kept for one release for dashboards loaded before it; it will be removed.availablebooleankeelobjectAlways
{"available": false}. Kept for one release for dashboards loaded before it; it will be removed.availableboolean