AF-compatible worker heartbeat
Updates `activeCount` on the worker's Redis record and resets its TTL. Returns pending work queue depth.
Short-lived worker runtime JWT minted by the platform. Claims bind the worker, project, organization, registration, and scopes.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workers/string/heartbeat" \ -H "Content-Type: application/json" \ -d '{ "activeCount": 0 }'{
"acknowledged": true,
"serverTime": "2019-08-24T14:15:22Z",
"pendingWorkCount": 0
}{
"error": "Session not found"
}{
"error": "Session not found"
}{
"error": "Session not found"
}Deregister a worker
Removes the worker from the registry and releases any remaining claims. Returns the list of sessions that were unclaimed as a result. Auth: runtime JWT only (`sub` must match worker ID).
Poll for queued work
Atomically pops and pre-claims work items from the priority queue (ZPOPMIN). Also returns inbox messages for the worker's active sessions. Workers that receive `preClaimed: true` must NOT make a separate claim call. Runtime-JWT callers also receive `gitCredentials` (short-lived GitHub PAT) and optionally `batchWork` (code-survival scan items, gated on the `code-survival-scan` capability).