Skip to main content

Claim Next Agent Job

GET 

/api/automation/runner/jobs/next

Claim the next queued job for one of the templates this runner advertised (see Send Agent Runner Heartbeat). The claim is atomic - two runners never receive the same job - and starts a 60-second lease that progress reports renew. If the lease lapses the job goes back to the queue; after 3 attempts it fails.

Authorization

Called by your own agent or script with the token SKU issued for this runner or callback, sent as Authorization: Bearer <token> — not with a Personal Access Token or a session.

Authenticate with the runner token as Authorization: Bearer <runner token> (not a Personal Access Token).

Query parameters

  • wait (optional, integer 0-25) - long-poll: hold the request up to this many seconds waiting for a job. Default 0 (return immediately).

Responses

  • 200 - job: id (use it in the progress / complete / fail calls), template, data (the values the Agent task step passed), execution_url (the run's page in the app), attempt (1 on the first try).
  • 204 - no job available (empty body).
  • 401 invalid or revoked token, 422 wait out of range, 429 above 240 requests a minute per token.

Request​

Responses​

OK

Response Headers
    Content-Type