API Reference

Worker API

Register workers, poll for jobs, send heartbeats, and complete or fail jobs. Workers are the execution layer that handles your service tasks.

Overview· Workers· Incidents· Versioning· Correlation IDs· Job Policies
POST /api/v1/workers/register Register a worker

Registers a worker instance and returns a workerId used in subsequent heartbeat and job poll calls. Workers should call this on startup and re-register on restart.

Request body

FieldTypeRequiredDescription
workerNamestringrequiredHuman-readable name for this worker instance (e.g. payment-worker-01).
jobTypesstring[]requiredList of task definition types this worker can handle.
maxJobsActiveintegeroptionalMax concurrent jobs. Defaults to 32.

Example request

{
  "workerName": "payment-worker-01",
  "jobTypes": ["payment:charge", "payment:refund"],
  "maxJobsActive": 10
}

Example response 200 OK

{
  "workerId": "wrk_abc123",
  "registeredAt": "2026-04-06T09:00:00Z"
}
POST /api/v1/workers/heartbeat Send heartbeat

Workers must send a heartbeat every 30 seconds. Workers that miss 3 consecutive heartbeats are marked inactive and their in-progress job locks are released.

Request body

FieldTypeRequiredDescription
workerIdstringrequiredWorker ID from the registration response.
jobsActiveintegeroptionalCurrent number of active jobs being processed.

Example request

{ "workerId": "wrk_abc123", "jobsActive": 3 }

Response 204 No Content

POST /api/v1/jobs/activate Poll and lock jobs

Atomically locks and returns up to maxJobsToActivate jobs matching the given job types. Jobs remain locked for the duration of timeout milliseconds.

Request body

FieldTypeRequiredDescription
workerIdstringrequiredYour worker's ID.
jobTypestringrequiredTask definition type to poll for.
maxJobsToActivateintegeroptionalMax jobs to return. Defaults to 1.
timeoutintegeroptionalLock duration in milliseconds. Defaults to 30 000.
variablesstring[]optionalVariable names to fetch with the job. Omit for all variables.

Example request

{
  "workerId": "wrk_abc123",
  "jobType": "payment:charge",
  "maxJobsToActivate": 5,
  "timeout": 60000,
  "variables": ["orderId", "amount", "currency"]
}

Example response 200 OK

{
  "jobs": [
    {
      "key": "job_xyz789",
      "type": "payment:charge",
      "processInstanceKey": "pi_111",
      "variables": { "orderId": "ORD-42", "amount": 9900, "currency": "EUR" },
      "deadline": "2026-04-06T09:01:00Z"
    }
  ]
}
POST /api/v1/jobs/{jobKey}/complete Complete a job

Marks a job as successfully completed. Optionally merges output variables back into the process instance. The process engine resumes from the next step.

Request body

FieldTypeRequiredDescription
variablesobjectoptionalOutput variables to merge into the process instance scope.

Example request

{ "variables": { "chargeId": "ch_stripe_abc", "status": "succeeded" } }

Response 204 No Content

POST /api/v1/jobs/{jobKey}/fail Fail a job

Marks a job as failed. Set retries to control how many more attempts are allowed. When retries reach 0, an incident is raised.

Request body

FieldTypeRequiredDescription
retriesintegerrequiredRemaining retries. Set to 0 to create an incident immediately.
errorMessagestringoptionalHuman-readable failure reason, shown in the incident.
retryBackoffintegeroptionalMilliseconds to wait before the job becomes available again.

Example request

{ "retries": 2, "errorMessage": "Stripe timeout", "retryBackoff": 5000 }

Response 204 No Content

GET /api/v1/workers List registered workers

Returns all currently registered workers and their status.

Example response 200 OK

{
  "workers": [
    {
      "workerId": "wrk_abc123",
      "workerName": "payment-worker-01",
      "jobTypes": ["payment:charge"],
      "status": "active",
      "lastHeartbeat": "2026-04-06T09:00:55Z"
    }
  ]
}
See also:   Incident management · Job policies & retry configuration · Interactive API explorer