Every endpoint and schema of the QueueFlow REST API (OpenAPI 0.6.0), generated from the spec the server itself emits.
The server emits this document at /openapi.json and serves an interactive Swagger UI at /docs. A copy of the spec used to build this page is at /openapi.json; the canonical file lives in the queueflow-core repository and is attached to every release.
All /api/v1 routes require Authorization: Bearer <token>. Tenant routes take a tenant token (API key or JWT); the worker-protocol routes take the deployment's worker token. See Authentication and tenants. Durations are plain integer seconds; timestamps are RFC 3339 strings in UTC. Error responses share one shape:
json
{"error":"job not found","timestamp":"2026-10-06T12:00:00Z"}
Dead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limit
query
integer (int64)
Page size, 1..=100 (default 50).
offset
query
integer (int64)
Number of records to skip (default 0).
order_by
query
string
created_at ASC or created_at DESC (default DESC).
include_total
query
boolean
Include the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursor
query
string
Opaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_after
query
string (date-time)
Only rows created at or after this instant (RFC 3339, inclusive). With created_before this forms the half-open range [after, before) — the natural shape for walking history period by period.
created_before
query
string (date-time)
Only rows created strictly before this instant (RFC 3339, exclusive).
Optional client-supplied key making this create idempotent per tenant: retrying with the same key returns the original job instead of creating a duplicate.
CancelJobsRequestWhich jobs a bulk cancel applies to. Every field is optional; an empty body cancels the caller's oldest non-terminal jobs up to limit.
Field
Type
Description
created_after
string (date-time) | null
Only jobs created at or after this instant (RFC 3339, inclusive).
created_before
string (date-time) | null
Only jobs created strictly before this instant (RFC 3339, exclusive).
limit
integer (int64) | null
Cancel at most this many (oldest first). Default 100; the maximum is the server's batch limit (--max-batch, 1000 by default).
queue
string | null
Only jobs on this queue.
status
string | null
Only jobs in this state: pending, retrying or running (all three when omitted). Terminal states are rejected: history is never rewritten.
Matching non-terminal jobs of the caller's tenant were cancelled, oldest first, up to limit. Repeat until cancelled is below limit to drain a large set.
Stream a job's status transitions as Server-Sent Events until it reaches a terminal state. Lets clients await completion without polling the REST endpoint themselves.
Parameters
Name
In
Type
Description
idrequired
path
string
Job id
Responses
Status
Body
Meaning
200
string text/event-stream
SSE stream; each status event carries the full job JSON. Closes after the job reaches a terminal state.
Dead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limit
query
integer (int64)
Page size, 1..=100 (default 50).
offset
query
integer (int64)
Number of records to skip (default 0).
order_by
query
string
created_at ASC or created_at DESC (default DESC).
include_total
query
boolean
Include the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursor
query
string
Opaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_after
query
string (date-time)
Only rows created at or after this instant (RFC 3339, inclusive). With created_before this forms the half-open range [after, before) — the natural shape for walking history period by period.
created_before
query
string (date-time)
Only rows created strictly before this instant (RFC 3339, exclusive).
Whole-workflow time budget in seconds. When it runs out the janitor cancels every unfinished step and fails the workflow with workflow timed out. Unset means no limit. (min 0)
SSE stream; each status event carries a WorkflowEvent (the workflow status and every step's state). The first event is the current state; the stream closes after the terminal one, or after 15 minutes (reconnect to keep following).
The workflow is running again: every step that did not complete went back to pending and is re-scheduled; completed steps keep their results. The deadline, if any, is re-armed from the original timeout.
Dead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limit
query
integer (int64)
Page size, 1..=100 (default 50).
offset
query
integer (int64)
Number of records to skip (default 0).
order_by
query
string
created_at ASC or created_at DESC (default DESC).
include_total
query
boolean
Include the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursor
query
string
Opaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_after
query
string (date-time)
Only rows created at or after this instant (RFC 3339, inclusive). With created_before this forms the half-open range [after, before) — the natural shape for walking history period by period.
created_before
query
string (date-time)
Only rows created strictly before this instant (RFC 3339, exclusive).
Dead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limit
query
integer (int64)
Page size, 1..=100 (default 50).
offset
query
integer (int64)
Number of records to skip (default 0).
order_by
query
string
created_at ASC or created_at DESC (default DESC).
include_total
query
boolean
Include the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursor
query
string
Opaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_after
query
string (date-time)
Only rows created at or after this instant (RFC 3339, inclusive). With created_before this forms the half-open range [after, before) — the natural shape for walking history period by period.
created_before
query
string (date-time)
Only rows created strictly before this instant (RFC 3339, exclusive).
ReplayDeadLettersRequestWhich dead letters a bulk replay applies to. Every field is optional; an empty body replays the caller's oldest unreplayed dead letters up to limit.
Field
Type
Description
created_after
string (date-time) | null
Only entries created at or after this instant (RFC 3339, inclusive).
created_before
string (date-time) | null
Only entries created strictly before this instant (RFC 3339, exclusive).
limit
integer (int64) | null
Consider at most this many entries (oldest first). Default 100; the maximum is the server's batch limit (--max-batch).
Every unreplayed dead letter matching the filter (oldest first, up to limit) was replayed as a fresh job, or is listed with the reason it could not be.
Backlog per queue for the caller's tenant: claimable (pending), waiting for a future run time (scheduled), and running counts, how long the oldest claimable job has waited, and whether the queue is paused. Lists every queue the tenant has enqueued to (since 0.5.0) and any with non-terminal jobs.
Claims of the caller's jobs on this queue are paused: pending jobs wait, running jobs finish. The queue is drained once running reaches zero. Idempotent.
Durable counts for the caller's tenant, read from the store: jobs in the store (jobs_created), jobs completed / failed, the sum of retries, dead letters, and the same for workflows. Fleet-wide and restart-safe, but retention deletes history, so counts can go down. Process-local engine counters are exposed on the Prometheus metrics port instead.
How many jobs this call cancelled. Less than limit means the matching set is exhausted (jobs finishing concurrently are left as they ended, never overwritten). (min 0)
Whole-workflow time budget in seconds. When it runs out the janitor cancels every unfinished step and fails the workflow with workflow timed out. Unset means no limit. (min 0)
A recurring enqueue schedule. Expressions are standard 5-field crontab (minute hour day-of-month month day-of-week), evaluated in UTC; a 6/7-field form with leading seconds is also accepted.
Field
Type
Description
created_atrequired
string (date-time)
cron_exprrequired
string
enabledrequired
boolean
idrequired
string
namerequired
string
Unique per tenant.
next_run_atrequired
string (date-time)
The next instant this schedule fires. Missed occurrences (server down) collapse into at most one catch-up firing.
A dead-lettered job: a terminal failure recorded for inspection and replay. The original job row remains (subject to retention); this entry captures why it died and, once replayed, which fresh job took its place.
Field
Type
Description
created_atrequired
string (date-time)
idrequired
integer (int64)
job_idrequired
string
reasonrequired
string
Why the job dead-lettered: max_attempts_exceeded, non_retryable, or handler_not_found.
error_message
string | null
queue_name
string | null
replay_job_id
string | null
The fresh job created by the replay.
replayed_at
string (date-time) | null
Set once this entry has been replayed; a dead letter replays at most once.
Dynamic fan-out: run the step's task once per element of the array found at path in the workflow context. Each child job receives the step payload plus the element under item_key and its position under _index. The step completes when every child has, with the result {"results": [...]} in element order; a failed child follows the step's on_failure policy.
Field
Type
Description
pathrequired
string
Dotted path into the context, for example fetch.images.
item_key
string | null
Payload key the element is passed under (default item).
max_items
integer (int32) | null
Upper bound on elements; more than this fails the step before any child runs. Default [limits::MAX_FAN_OUT]. (min 0)
The job's current status. running means the lease was extended; anything else (cancelled, completed, ...) means it was not, and the worker should stop working on the job.
When the job becomes claimable. created_at for immediate jobs, the requested run_at for scheduled jobs, and the next backoff instant while retrying — the durable delay lives in the row itself.
How many times this job has been claimed (delivered to a worker). Greater than retry_count + 1 means a lease expired without a report — i.e. a worker crashed mid-run. (min 0)
error_message
string | null
idempotency_key
string | null
Client-supplied key that makes job creation idempotent per tenant: re-submitting the same key returns the original job instead of creating a duplicate.
metadata
object
next_retry_at
string (date-time) | null
When this job's next retry becomes claimable (mirrors scheduled_at while the job is retrying; kept for audit/inspection).
payload
object
result
object | null
started_at
string (date-time) | null
tenant_id
string | null
workflow_id
string | null
workflow_step_id
string | null
The owning workflow step's name (steps are addressed by name).
Per-job execution configuration. All durations are in seconds. Deserialization is partial-friendly: any omitted field takes its [JobConfig::default] value (via per-field serde defaults), so workflow-step and cron config overrides can name just the fields they change, and out-of-band rows with sparse config JSONB still load. Per-field functions rather than a struct-level #[serde(default)]: the struct-level form makes utoipa attach a default beside the BackoffStrategy$ref, which forces a synthetic wrapper type into every generated SDK.
Field
Type
Description
jitter_factor
number (double) | null
Optional jitter in 0.0..=1.0. 0.1 => +/-10% randomization of each retry delay, which spreads out thundering-herd retries.
max_retries
integer (int32)
(min 0)
priority
integer (int32)
Higher is claimed first within a queue; ties break on scheduled_at, then created_at.
Opaque, unguessable proof of lease ownership, regenerated on every claim. Pass it back on heartbeat/complete/fail; a stale token (the lease expired and the job was reclaimed) is rejected.
Opaque keyset cursor for the next page (present when has_more). Pass it back as cursor to continue where this page ended; cheaper than deep OFFSET paging.
total
integer (int64) | null
Exact total match count; only present when include_total=true.
Opaque keyset cursor for the next page (present when has_more). Pass it back as cursor to continue where this page ended; cheaper than deep OFFSET paging.
total
integer (int64) | null
Exact total match count; only present when include_total=true.
Opaque keyset cursor for the next page (present when has_more). Pass it back as cursor to continue where this page ended; cheaper than deep OFFSET paging.
total
integer (int64) | null
Exact total match count. Only present when the request set include_total=true; computing it costs a full count over the filtered set, so it is opt-in.
Opaque keyset cursor for the next page (present when has_more). Pass it back as cursor to continue where this page ended; cheaper than deep OFFSET paging.
total
integer (int64) | null
Exact total match count; only present when include_total=true.
Live, per-queue backlog figures read from the store: what an operator watches to decide whether to add workers. Only non-terminal jobs are counted, so the query stays cheap on a large history table. Durable totals live in [StatsSnapshot] via JobStore::count_stats.
Field
Type
Description
pendingrequired
integer (int64)
Claimable now: pending or retrying with scheduled_at in the past. (min 0)
queuerequired
string
runningrequired
integer (int64)
Currently leased by a worker. (min 0)
scheduledrequired
integer (int64)
Waiting for a future scheduled_at (a run_at job or a backoff retry). (min 0)
oldest_pending_age_secs
integer (int64) | null
Seconds the oldest claimable job has been waiting, None when nothing is claimable. The queue's primary health signal: it grows when workers cannot keep up and stays near zero when they can. (min 0)
paused
boolean
Claims for this tenant's jobs on the queue are paused (see POST /api/v1/queues/{queue}/pause). Pending jobs accumulate; running ones finish. In the all-tenants view this is true only when every registered tenant of the queue is paused.
One entry per queue the caller has enqueued to (since 0.5.0, whether or not it currently has jobs) or that currently has non-terminal jobs, sorted by name.
A predicate over the workflow context, evaluated when a step becomes ready. Exactly one of path, all, any or not is set. A leaf names a dotted path into the context (step results live under their step name, so validate.ok is the ok key of the validate step's result) and compares it with value using op. A false condition skips the step with the reason condition not met; its dependents still run, seeing no result for it.
A node in a workflow DAG. Steps are addressed by their unique name; depends_on lists the names of steps that must complete first. A step is one of three kinds: a plain task (task_name), a fan-out (task_name plus fan_out), or a sub-workflow (workflow, in which case task_name may be empty). when gates any kind on the context.
Run only when this condition holds against the workflow context at the moment the step becomes ready; otherwise the step is skipped with reason condition not met and its dependents proceed.
Run an inline child workflow instead of a task. The child's context is its own declared context plus this step's payload, with the parent's context under _parent; the step's result is the child's final context.