Job Lifecycle
Every job moves through a state machine from creation to completion (or death).
Every job moves through a state machine from creation to completion (or death).
A job starts Pending and moves to Running once a worker claims it. From
there it either finishes as Complete, or the task raises and it goes back
to Pending to wait out the retry backoff (if attempts remain) or to Dead
once max_retries is exhausted — landing in the dead-letter queue. A job can
also move directly from Pending to Cancelled if it's cancelled before a
worker picks it up.
| Status | Integer | Description |
|---|---|---|
| Pending | 0 | Waiting to be picked up |
| Running | 1 | Currently executing |
| Complete | 2 | Finished successfully |
| Failed | 3 | Last attempt failed (may retry) |
| Dead | 4 | All retries exhausted, in DLQ |
| Cancelled | 5 | Cancelled before execution |
A single job's status field is "complete" (matches the Complete row
above). Aggregate views — queue.stats() and the flexiq info CLI —
bucket finished jobs under the key "completed" instead. list_jobs(status=)
accepts either spelling.