QueueFlowDocs

Reference

REST API reference

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" }

#Endpoints

GET/healthgetHealth
GET/readygetReady
GET/api/v1/jobslistJobs
POST/api/v1/jobscreateJob
POST/api/v1/jobs/batchcreateBatchJobs
POST/api/v1/jobs/cancelcancelJobs
GET/api/v1/jobs/{id}getJob
POST/api/v1/jobs/{id}/cancelcancelJob
GET/api/v1/jobs/{id}/eventsstreamJobEvents
GET/api/v1/workflowslistWorkflows
POST/api/v1/workflowscreateWorkflow
GET/api/v1/workflows/{id}getWorkflow
POST/api/v1/workflows/{id}/cancelcancelWorkflow
GET/api/v1/workflows/{id}/diagramgetWorkflowDiagram
GET/api/v1/workflows/{id}/eventsstreamWorkflowEvents
POST/api/v1/workflows/{id}/retryretryWorkflow
GET/api/v1/workflows/{id}/stepsgetWorkflowStepStates
GET/api/v1/cronlistCrons
POST/api/v1/croncreateCron
GET/api/v1/cron/{id}getCron
DELETE/api/v1/cron/{id}deleteCron
POST/api/v1/cron/{id}/pausepauseCron
POST/api/v1/cron/{id}/resumeresumeCron
GET/api/v1/dlqlistDeadLetters
POST/api/v1/dlq/replayreplayDeadLetters
GET/api/v1/dlq/{id}getDeadLetter
POST/api/v1/dlq/{id}/replayreplayDeadLetter
POST/api/v1/jobs/{id}/completecompleteJob
POST/api/v1/jobs/{id}/failfailJob
POST/api/v1/jobs/{id}/heartbeatheartbeatJob
POST/api/v1/queues/{queue}/leaseleaseJobs
GET/api/v1/queueslistQueues
POST/api/v1/queues/{queue}/pausepauseQueue
POST/api/v1/queues/{queue}/resumeresumeQueue
GET/api/v1/statsgetStats
GET/api/v1/taskslistTasks
GET/api/v1/whoamiwhoAmI

#Health

Liveness and readiness probes

#GET /health

operationId getHealth no auth

Responses

StatusBodyMeaning
200HealthStatusHealthy
503ErrorBodyDatabase unavailable

#GET /ready

operationId getReady no auth

Responses

StatusBodyMeaning
200ReadyStatusReady
503ErrorBodyNot ready

#Jobs

Job lifecycle

#GET /api/v1/jobs

operationId listJobs

Parameters

NameInTypeDescription
statusquerystringFilter by status (e.g. pending, completed).
queuequerystringFilter by queue name (jobs only).
task_namequerystringFilter by task name (jobs and dead letters).
replayedquerybooleanDead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limitqueryinteger (int64)Page size, 1..=100 (default 50).
offsetqueryinteger (int64)Number of records to skip (default 0).
order_byquerystringcreated_at ASC or created_at DESC (default DESC).
include_totalquerybooleanInclude the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursorquerystringOpaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_afterquerystring (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_beforequerystring (date-time)Only rows created strictly before this instant (RFC 3339, exclusive).

Responses

StatusBodyMeaning
200ListJobsResponsePage of jobs
401ErrorBodyUnauthorized

#POST /api/v1/jobs

operationId createJob

Parameters

NameInTypeDescription
Idempotency-Keyheaderstring | nullOptional client-supplied key making this create idempotent per tenant: retrying with the same key returns the original job instead of creating a duplicate.

Request body application/json

CreateJobRequest

FieldTypeDescription
task_namerequiredstringThe registered task handler to invoke.
configJobConfigRequest | null
payloadobjectArbitrary JSON object passed to the handler.
run_atstring (date-time) | nullDon't run before this instant (RFC 3339). The job is created immediately but stays invisible to workers until then.

Responses

StatusBodyMeaning
201CreateJobResponseJob created (or replayed idempotently)
400ErrorBodyInvalid request
401ErrorBodyUnauthorized

#POST /api/v1/jobs/batch

operationId createBatchJobs

Request body application/json

CreateBatchJobsRequest

FieldTypeDescription
jobsrequiredarray<CreateJobRequest>

Responses

StatusBodyMeaning
201CreateBatchJobsResponseJobs created
400ErrorBodyInvalid request
401ErrorBodyUnauthorized

#POST /api/v1/jobs/cancel

operationId cancelJobs

Request body application/json

CancelJobsRequest Which jobs a bulk cancel applies to. Every field is optional; an empty body cancels the caller's oldest non-terminal jobs up to limit.

FieldTypeDescription
created_afterstring (date-time) | nullOnly jobs created at or after this instant (RFC 3339, inclusive).
created_beforestring (date-time) | nullOnly jobs created strictly before this instant (RFC 3339, exclusive).
limitinteger (int64) | nullCancel at most this many (oldest first). Default 100; the maximum is the server's batch limit (--max-batch, 1000 by default).
queuestring | nullOnly jobs on this queue.
statusstring | nullOnly jobs in this state: pending, retrying or running (all three when omitted). Terminal states are rejected: history is never rewritten.
task_namestring | nullOnly jobs for this task.

Responses

StatusBodyMeaning
200CancelJobsResponseMatching 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.
400ErrorBodyInvalid filter (for example a terminal status)
401ErrorBodyUnauthorized
403ErrorBodyForbidden

#GET /api/v1/jobs/{id}

operationId getJob

Parameters

NameInTypeDescription
idrequiredpathstringJob id

Responses

StatusBodyMeaning
200JobJob
403ErrorBodyForbidden
404ErrorBodyNot found

#POST /api/v1/jobs/{id}/cancel

operationId cancelJob

Parameters

NameInTypeDescription
idrequiredpathstringJob id

Responses

StatusBodyMeaning
204emptyCancelled
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#GET /api/v1/jobs/{id}/events

operationId streamJobEvents

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

NameInTypeDescription
idrequiredpathstringJob id

Responses

StatusBodyMeaning
200string text/event-streamSSE stream; each status event carries the full job JSON. Closes after the job reaches a terminal state.
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#Workflows

Workflow orchestration (DAG of steps)

#GET /api/v1/workflows

operationId listWorkflows

Parameters

NameInTypeDescription
statusquerystringFilter by status (e.g. pending, completed).
queuequerystringFilter by queue name (jobs only).
task_namequerystringFilter by task name (jobs and dead letters).
replayedquerybooleanDead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limitqueryinteger (int64)Page size, 1..=100 (default 50).
offsetqueryinteger (int64)Number of records to skip (default 0).
order_byquerystringcreated_at ASC or created_at DESC (default DESC).
include_totalquerybooleanInclude the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursorquerystringOpaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_afterquerystring (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_beforequerystring (date-time)Only rows created strictly before this instant (RFC 3339, exclusive).

Responses

StatusBodyMeaning
200ListWorkflowsResponsePage of workflows
401ErrorBodyUnauthorized

#POST /api/v1/workflows

operationId createWorkflow

Request body application/json

CreateWorkflowRequest Request body for creating a workflow. Shared by the builder DSL and the API so callers and SDKs use the same contract.

FieldTypeDescription
namerequiredstring
stepsrequiredarray<WorkflowStep>
contextobject
metadataobject
timeout_secsinteger (int64) | nullWhole-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)

Responses

StatusBodyMeaning
201CreateWorkflowResponseWorkflow created
400ErrorBodyInvalid workflow (e.g. dependency cycle)
401ErrorBodyUnauthorized

#GET /api/v1/workflows/{id}

operationId getWorkflow

Parameters

NameInTypeDescription
idrequiredpathstringWorkflow id

Responses

StatusBodyMeaning
200WorkflowWorkflow
403ErrorBodyForbidden
404ErrorBodyNot found

#POST /api/v1/workflows/{id}/cancel

operationId cancelWorkflow

Parameters

NameInTypeDescription
idrequiredpathstringWorkflow id

Responses

StatusBodyMeaning
204emptyCancelled
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#GET /api/v1/workflows/{id}/diagram

operationId getWorkflowDiagram

Parameters

NameInTypeDescription
idrequiredpathstringWorkflow id

Responses

StatusBodyMeaning
200WorkflowDiagramResponseMermaid diagram of the workflow DAG
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#GET /api/v1/workflows/{id}/events

operationId streamWorkflowEvents

Stream a workflow's progress as Server-Sent Events: one status event whenever the workflow or any step changes, until the workflow is terminal.

Parameters

NameInTypeDescription
idrequiredpathstringWorkflow id

Responses

StatusBodyMeaning
200WorkflowEvent text/event-streamSSE 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).
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#POST /api/v1/workflows/{id}/retry

operationId retryWorkflow

Parameters

NameInTypeDescription
idrequiredpathstringWorkflow id

Responses

StatusBodyMeaning
204emptyThe 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.
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found
409ErrorBodyThe workflow is running or completed

#GET /api/v1/workflows/{id}/steps

operationId getWorkflowStepStates

Parameters

NameInTypeDescription
idrequiredpathstringWorkflow id

Responses

StatusBodyMeaning
200WorkflowStepStatesResponseRuntime status of every step, in declaration order. The workflow record carries only step definitions; this is the live progress view.
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#Cron

Recurring enqueues on a cron schedule (UTC)

#GET /api/v1/cron

operationId listCrons

Parameters

NameInTypeDescription
statusquerystringFilter by status (e.g. pending, completed).
queuequerystringFilter by queue name (jobs only).
task_namequerystringFilter by task name (jobs and dead letters).
replayedquerybooleanDead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limitqueryinteger (int64)Page size, 1..=100 (default 50).
offsetqueryinteger (int64)Number of records to skip (default 0).
order_byquerystringcreated_at ASC or created_at DESC (default DESC).
include_totalquerybooleanInclude the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursorquerystringOpaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_afterquerystring (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_beforequerystring (date-time)Only rows created strictly before this instant (RFC 3339, exclusive).

Responses

StatusBodyMeaning
200ListCronsResponsePage of cron schedules (status/queue filters do not apply)
401ErrorBodyUnauthorized

#POST /api/v1/cron

operationId createCron

Request body application/json

CreateCronRequest Request body for creating a cron schedule.

FieldTypeDescription
cron_exprrequiredstring5-field crontab (UTC); 6/7 fields with leading seconds also accepted.
namerequiredstringUnique per tenant.
task_namerequiredstring
configJobConfig | null
payloadobject
queuestring | null

Responses

StatusBodyMeaning
201CreateCronResponseSchedule created; first firing is the next occurrence (UTC)
400ErrorBodyInvalid request (e.g. a bad cron expression)
401ErrorBodyUnauthorized
409ErrorBodyA schedule with this name already exists

#GET /api/v1/cron/{id}

operationId getCron

Parameters

NameInTypeDescription
idrequiredpathstringCron schedule id

Responses

StatusBodyMeaning
200CronScheduleCron schedule
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#DELETE /api/v1/cron/{id}

operationId deleteCron

Parameters

NameInTypeDescription
idrequiredpathstringCron schedule id

Responses

StatusBodyMeaning
204emptyDeleted; already-enqueued jobs are unaffected
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#POST /api/v1/cron/{id}/pause

operationId pauseCron

Parameters

NameInTypeDescription
idrequiredpathstringCron schedule id

Responses

StatusBodyMeaning
204emptyPaused: no further firings until resumed
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#POST /api/v1/cron/{id}/resume

operationId resumeCron

Parameters

NameInTypeDescription
idrequiredpathstringCron schedule id

Responses

StatusBodyMeaning
204emptyResumed: fires at its next future occurrence (missed runs are not caught up)
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#Dlq

Dead-letter queue: inspect terminally-failed jobs and replay them as fresh jobs

#GET /api/v1/dlq

operationId listDeadLetters

Parameters

NameInTypeDescription
statusquerystringFilter by status (e.g. pending, completed).
queuequerystringFilter by queue name (jobs only).
task_namequerystringFilter by task name (jobs and dead letters).
replayedquerybooleanDead letters only: false lists entries not yet replayed, true the replayed ones; both when omitted.
limitqueryinteger (int64)Page size, 1..=100 (default 50).
offsetqueryinteger (int64)Number of records to skip (default 0).
order_byquerystringcreated_at ASC or created_at DESC (default DESC).
include_totalquerybooleanInclude the exact total count in the response (default false; the count is an extra full scan over the filtered set).
cursorquerystringOpaque keyset cursor from a previous page's next_cursor. When set, offset is ignored and listing continues where that page ended.
created_afterquerystring (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_beforequerystring (date-time)Only rows created strictly before this instant (RFC 3339, exclusive).

Responses

StatusBodyMeaning
200ListDeadLettersResponsePage of dead letters, newest first. queue, task_name, replayed and the time window apply; status does not.
401ErrorBodyUnauthorized

#POST /api/v1/dlq/replay

operationId replayDeadLetters

Request body application/json

ReplayDeadLettersRequest Which 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.

FieldTypeDescription
created_afterstring (date-time) | nullOnly entries created at or after this instant (RFC 3339, inclusive).
created_beforestring (date-time) | nullOnly entries created strictly before this instant (RFC 3339, exclusive).
limitinteger (int64) | nullConsider at most this many entries (oldest first). Default 100; the maximum is the server's batch limit (--max-batch).
queuestring | nullOnly dead letters from this queue.
task_namestring | nullOnly dead letters for this task.

Responses

StatusBodyMeaning
200ReplayDeadLettersResponseEvery 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.
401ErrorBodyUnauthorized
403ErrorBodyForbidden

#GET /api/v1/dlq/{id}

operationId getDeadLetter

Parameters

NameInTypeDescription
idrequiredpathinteger (int64)Dead letter id

Responses

StatusBodyMeaning
200DeadLetterDead letter
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found

#POST /api/v1/dlq/{id}/replay

operationId replayDeadLetter

Parameters

NameInTypeDescription
idrequiredpathinteger (int64)Dead letter id

Responses

StatusBodyMeaning
201ReplayDeadLetterResponseA fresh job was created from the dead-lettered one (same task/payload/queue/config; workflow linkage is not resurrected)
401ErrorBodyUnauthorized
403ErrorBodyForbidden
404ErrorBodyNot found (the entry, or its original job after retention)
409ErrorBodyAlready replayed

#Worker

Remote worker protocol: lease jobs, heartbeat, report completion/failure. Lets handlers run in any language, outside the server binary.

#POST /api/v1/jobs/{id}/complete

operationId completeJob

Parameters

NameInTypeDescription
idrequiredpathstringJob id

Request body application/json

CompleteJobRequest Body for POST /api/v1/jobs/{id}/complete.

FieldTypeDescription
lease_tokenrequiredstringThe lease token returned by the lease call.
resultobjectHandler result, recorded on the job and merged into workflow context.

Responses

StatusBodyMeaning
204emptyCompleted (idempotent: replaying against an already-finished job also succeeds)
401ErrorBodyUnauthorized
403ErrorBodyAuthenticated, but not with the worker credential
404ErrorBodyNot found
409ErrorBodyLease no longer held (expired and reclaimed)

#POST /api/v1/jobs/{id}/fail

operationId failJob

Parameters

NameInTypeDescription
idrequiredpathstringJob id

Request body application/json

FailJobRequest Body for POST /api/v1/jobs/{id}/fail.

FieldTypeDescription
errorrequiredstringHuman-readable failure reason.
lease_tokenrequiredstringThe lease token returned by the lease call.
retryablebooleanWhether the engine may retry (subject to the job's max_retries). Defaults to true; send false for permanent failures (e.g. bad input).

Responses

StatusBodyMeaning
204emptyFailure recorded; the job is retried or dead-lettered per its config
401ErrorBodyUnauthorized
403ErrorBodyAuthenticated, but not with the worker credential
404ErrorBodyNot found
409ErrorBodyLease no longer held (expired and reclaimed)

#POST /api/v1/jobs/{id}/heartbeat

operationId heartbeatJob

Parameters

NameInTypeDescription
idrequiredpathstringJob id

Request body application/json

HeartbeatRequest Body for POST /api/v1/jobs/{id}/heartbeat.

FieldTypeDescription
extend_secsrequiredinteger (int32)New lease duration in seconds, measured from now (1..=3600). (min 0)
lease_tokenrequiredstringThe lease token returned by the lease call.

Responses

StatusBodyMeaning
200HeartbeatResponseCurrent job status. running = lease extended; anything else (e.g. cancelled) = not extended, stop working on the job.
401ErrorBodyUnauthorized
403ErrorBodyAuthenticated, but not with the worker credential
404ErrorBodyNot found
409ErrorBodyLease no longer held (expired and reclaimed)

#POST /api/v1/queues/{queue}/lease

operationId leaseJobs

Parameters

NameInTypeDescription
queuerequiredpathstringQueue to lease from

Request body application/json

LeaseJobsRequest Body for POST /api/v1/queues/{queue}/lease.

FieldTypeDescription
lease_secsinteger (int32) | nullLease duration in seconds (1..=3600, default 30). Heartbeat to extend. (min 0)
max_jobsinteger | nullMaximum jobs to lease in one call (1..=100, default 1). (min 0)
wait_secsinteger (int32) | nullLong-poll wait when the queue is empty, in seconds (0..=30, default 0). (min 0)

Responses

StatusBodyMeaning
200LeaseJobsResponseZero or more leased jobs (empty if none became available within wait_secs)
401ErrorBodyUnauthorized
403ErrorBodyAuthenticated, but not with the worker credential

#System

Introspection and metrics

#GET /api/v1/queues

operationId listQueues

Responses

StatusBodyMeaning
200QueuesResponseBacklog 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.

#POST /api/v1/queues/{queue}/pause

operationId pauseQueue

Parameters

NameInTypeDescription
queuerequiredpathstringQueue name

Responses

StatusBodyMeaning
200QueueControlResponseClaims 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.
400ErrorBodyInvalid queue name
401ErrorBodyUnauthorized
403ErrorBodyForbidden

#POST /api/v1/queues/{queue}/resume

operationId resumeQueue

Parameters

NameInTypeDescription
queuerequiredpathstringQueue name

Responses

StatusBodyMeaning
200QueueControlResponseClaims resume immediately; parked workers are woken. Idempotent.
400ErrorBodyInvalid queue name
401ErrorBodyUnauthorized
403ErrorBodyForbidden

#GET /api/v1/stats

operationId getStats

Responses

StatusBodyMeaning
200StatsSnapshotDurable 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.

#GET /api/v1/tasks

operationId listTasks

Responses

StatusBodyMeaning
200TasksResponseRegistered task handlers

#GET /api/v1/whoami

operationId whoAmI

Responses

StatusBodyMeaning
200WhoAmIResponseThe tenant and access level of the bearer token
401ErrorBodyUnauthorized

#Schemas

Every request and response body is one of these objects. Fields marked required are always present; other fields may be absent or null.

#BackoffStrategy

How retry delays grow between attempts.

One of "fixed", "linear", "exponential".

#CancelJobsRequest

Which jobs a bulk cancel applies to. Every field is optional; an empty body cancels the caller's oldest non-terminal jobs up to limit.

FieldTypeDescription
created_afterstring (date-time) | nullOnly jobs created at or after this instant (RFC 3339, inclusive).
created_beforestring (date-time) | nullOnly jobs created strictly before this instant (RFC 3339, exclusive).
limitinteger (int64) | nullCancel at most this many (oldest first). Default 100; the maximum is the server's batch limit (--max-batch, 1000 by default).
queuestring | nullOnly jobs on this queue.
statusstring | nullOnly jobs in this state: pending, retrying or running (all three when omitted). Terminal states are rejected: history is never rewritten.
task_namestring | nullOnly jobs for this task.

#CancelJobsResponse

FieldTypeDescription
cancelledrequiredinteger (int64)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)

#CompleteJobRequest

Body for POST /api/v1/jobs/{id}/complete.

FieldTypeDescription
lease_tokenrequiredstringThe lease token returned by the lease call.
resultobjectHandler result, recorded on the job and merged into workflow context.

#ConditionOp

How a [StepCondition] leaf compares the value at path with value.

One of "eq", "ne", "gt", "gte", "lt", "lte", "exists", "contains", "in".

#CreateBatchJobsRequest

FieldTypeDescription
jobsrequiredarray<CreateJobRequest>

#CreateBatchJobsResponse

FieldTypeDescription
countrequiredinteger (min 0)
job_idsrequiredarray<string>

#CreateCronRequest

Request body for creating a cron schedule.

FieldTypeDescription
cron_exprrequiredstring5-field crontab (UTC); 6/7 fields with leading seconds also accepted.
namerequiredstringUnique per tenant.
task_namerequiredstring
configJobConfig | null
payloadobject
queuestring | null

#CreateCronResponse

FieldTypeDescription
cron_idrequiredstring

#CreateJobRequest

FieldTypeDescription
task_namerequiredstringThe registered task handler to invoke.
configJobConfigRequest | null
payloadobjectArbitrary JSON object passed to the handler.
run_atstring (date-time) | nullDon't run before this instant (RFC 3339). The job is created immediately but stays invisible to workers until then.

#CreateJobResponse

FieldTypeDescription
job_idrequiredstring

#CreateWorkflowRequest

Request body for creating a workflow. Shared by the builder DSL and the API so callers and SDKs use the same contract.

FieldTypeDescription
namerequiredstring
stepsrequiredarray<WorkflowStep>
contextobject
metadataobject
timeout_secsinteger (int64) | nullWhole-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)

#CreateWorkflowResponse

FieldTypeDescription
workflow_idrequiredstring

#CronSchedule

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.

FieldTypeDescription
created_atrequiredstring (date-time)
cron_exprrequiredstring
enabledrequiredboolean
idrequiredstring
namerequiredstringUnique per tenant.
next_run_atrequiredstring (date-time)The next instant this schedule fires. Missed occurrences (server down) collapse into at most one catch-up firing.
task_namerequiredstring
configJobConfig | null
last_enqueued_atstring (date-time) | null
payloadobject
queue_namestring | nullQueue for the enqueued jobs (the engine default when absent).
tenant_idstring | null

#DeadLetter

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.

FieldTypeDescription
created_atrequiredstring (date-time)
idrequiredinteger (int64)
job_idrequiredstring
reasonrequiredstringWhy the job dead-lettered: max_attempts_exceeded, non_retryable, or handler_not_found.
error_messagestring | null
queue_namestring | null
replay_job_idstring | nullThe fresh job created by the replay.
replayed_atstring (date-time) | nullSet once this entry has been replayed; a dead letter replays at most once.
task_namestring | null
tenant_idstring | null

#ErrorBody

FieldTypeDescription
errorrequiredstring
timestamprequiredstring (date-time)

#FailJobRequest

Body for POST /api/v1/jobs/{id}/fail.

FieldTypeDescription
errorrequiredstringHuman-readable failure reason.
lease_tokenrequiredstringThe lease token returned by the lease call.
retryablebooleanWhether the engine may retry (subject to the job's max_retries). Defaults to true; send false for permanent failures (e.g. bad input).

#FanOut

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.

FieldTypeDescription
pathrequiredstringDotted path into the context, for example fetch.images.
item_keystring | nullPayload key the element is passed under (default item).
max_itemsinteger (int32) | nullUpper bound on elements; more than this fails the step before any child runs. Default [limits::MAX_FAN_OUT]. (min 0)

#FanOutProgress

Counts over a fan-out step's child jobs.

FieldTypeDescription
completedrequiredinteger (int64) (min 0)
failedrequiredinteger (int64)Failed or cancelled children. (min 0)
totalrequiredinteger (int64) (min 0)

#HealthStatus

FieldTypeDescription
statusrequiredstring
timestamprequiredstring (date-time)
versionrequiredstring

#HeartbeatRequest

Body for POST /api/v1/jobs/{id}/heartbeat.

FieldTypeDescription
extend_secsrequiredinteger (int32)New lease duration in seconds, measured from now (1..=3600). (min 0)
lease_tokenrequiredstringThe lease token returned by the lease call.

#HeartbeatResponse

Response for POST /api/v1/jobs/{id}/heartbeat.

FieldTypeDescription
statusrequiredJobStatusThe 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.

#Job

A single unit of work.

FieldTypeDescription
configrequiredJobConfig
created_atrequiredstring (date-time)
idrequiredstring
queue_namerequiredstring
retry_countrequiredinteger (int32) (min 0)
scheduled_atrequiredstring (date-time)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.
statusrequiredJobStatus
task_namerequiredstring
completed_atstring (date-time) | null
delivery_countinteger (int32)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_messagestring | null
idempotency_keystring | nullClient-supplied key that makes job creation idempotent per tenant: re-submitting the same key returns the original job instead of creating a duplicate.
metadataobject
next_retry_atstring (date-time) | nullWhen this job's next retry becomes claimable (mirrors scheduled_at while the job is retrying; kept for audit/inspection).
payloadobject
resultobject | null
started_atstring (date-time) | null
tenant_idstring | null
workflow_idstring | null
workflow_step_idstring | nullThe owning workflow step's name (steps are addressed by name).

#JobConfig

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.

FieldTypeDescription
jitter_factornumber (double) | nullOptional jitter in 0.0..=1.0. 0.1 => +/-10% randomization of each retry delay, which spreads out thundering-herd retries.
max_retriesinteger (int32) (min 0)
priorityinteger (int32)Higher is claimed first within a queue; ties break on scheduled_at, then created_at.
retry_backoffBackoffStrategy
retry_delay_secsinteger (int64) (min 0)
retry_max_delay_secsinteger (int64) (min 0)
timeout_secsinteger (int64) (min 0)

#JobConfigRequest

Optional per-job configuration overrides.

FieldTypeDescription
jitter_factornumber (double) | nullRetry-delay jitter in 0.0..=1.0 (e.g. 0.1 = +/-10%).
max_retriesinteger (int32) | null (min 0)
priorityinteger (int32) | nullHigher is claimed first within a queue (ties: oldest first).
queuestring | nullOverride the destination queue.
retry_backoffBackoffStrategy | nullHow retry delays grow between attempts (default exponential).
retry_delay_secsinteger (int64) | nullBase retry delay, in seconds. (min 0)
retry_max_delay_secsinteger (int64) | nullUpper bound on any computed retry delay, in seconds. (min 0)
timeoutinteger (int64) | nullPer-attempt timeout, in seconds. (min 0)

#JobStatus

Lifecycle state of a single job.

One of "pending", "running", "completed", "failed", "retrying", "cancelled".

#LeaseJobsRequest

Body for POST /api/v1/queues/{queue}/lease.

FieldTypeDescription
lease_secsinteger (int32) | nullLease duration in seconds (1..=3600, default 30). Heartbeat to extend. (min 0)
max_jobsinteger | nullMaximum jobs to lease in one call (1..=100, default 1). (min 0)
wait_secsinteger (int32) | nullLong-poll wait when the queue is empty, in seconds (0..=30, default 0). (min 0)

#LeaseJobsResponse

FieldTypeDescription
jobsrequiredarray<LeasedJob>

#LeasedJob

A job leased to a (possibly remote) worker, together with the lease token needed to heartbeat, complete, or fail it.

FieldTypeDescription
jobrequiredJob
lease_tokenrequiredstringOpaque, 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.

#ListCronsResponse

FieldTypeDescription
cronsrequiredarray<CronSchedule>
has_morerequiredboolean
limitrequiredinteger (int64)
offsetrequiredinteger (int64)
next_cursorstring | nullOpaque 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.
totalinteger (int64) | nullExact total match count; only present when include_total=true.

#ListDeadLettersResponse

FieldTypeDescription
dead_lettersrequiredarray<DeadLetter>
has_morerequiredboolean
limitrequiredinteger (int64)
offsetrequiredinteger (int64)
next_cursorstring | nullOpaque 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.
totalinteger (int64) | nullExact total match count; only present when include_total=true.

#ListJobsResponse

FieldTypeDescription
has_morerequiredboolean
jobsrequiredarray<Job>
limitrequiredinteger (int64)
offsetrequiredinteger (int64)
next_cursorstring | nullOpaque 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.
totalinteger (int64) | nullExact 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.

#ListWorkflowsResponse

FieldTypeDescription
has_morerequiredboolean
limitrequiredinteger (int64)
offsetrequiredinteger (int64)
workflowsrequiredarray<Workflow>
next_cursorstring | nullOpaque 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.
totalinteger (int64) | nullExact total match count; only present when include_total=true.

#OnFailure

What to do with downstream steps when a step fails.

One of "halt", "skip", "continue".

#OnSuccess

Reserved for future expansion; only Continue is meaningful today.

One of "continue".

#QueueControlResponse

Pause or resume outcome: the queue's live counts with its new flag.

FieldTypeDescription
pausedrequiredbooleanClaims of the caller's jobs on this queue are paused.
pendingrequiredinteger (int64)Claimable jobs of the caller waiting on this queue. (min 0)
queuerequiredstring
runningrequiredinteger (int64)Jobs of the caller still leased by workers. A paused queue is drained once this reaches zero. (min 0)

#QueueStats

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.

FieldTypeDescription
pendingrequiredinteger (int64)Claimable now: pending or retrying with scheduled_at in the past. (min 0)
queuerequiredstring
runningrequiredinteger (int64)Currently leased by a worker. (min 0)
scheduledrequiredinteger (int64)Waiting for a future scheduled_at (a run_at job or a backoff retry). (min 0)
oldest_pending_age_secsinteger (int64) | nullSeconds 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)
pausedbooleanClaims 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.

#QueuesResponse

FieldTypeDescription
queuesrequiredarray<QueueStats>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.

#ReadyStatus

FieldTypeDescription
statusrequiredstring

#ReplayDeadLetterResponse

FieldTypeDescription
job_idrequiredstringThe fresh job created from the dead-lettered one.

#ReplayDeadLettersRequest

Which 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.

FieldTypeDescription
created_afterstring (date-time) | nullOnly entries created at or after this instant (RFC 3339, inclusive).
created_beforestring (date-time) | nullOnly entries created strictly before this instant (RFC 3339, exclusive).
limitinteger (int64) | nullConsider at most this many entries (oldest first). Default 100; the maximum is the server's batch limit (--max-batch).
queuestring | nullOnly dead letters from this queue.
task_namestring | nullOnly dead letters for this task.

#ReplayDeadLettersResponse

FieldTypeDescription
replayedrequiredinteger (int64)How many of results produced a job. (min 0)
resultsrequiredarray<ReplayedDeadLetter>Entries that were replayed (job_id set) or could not be (error set), oldest first. Entries already replayed are not listed.

#ReplayedDeadLetter

One dead letter's outcome in a bulk replay.

FieldTypeDescription
dead_letter_idrequiredinteger (int64)
errorstring | nullWhy it did not, for example the original job was purged by retention.
job_idstring | nullThe fresh job, when the replay succeeded.

#StatsSnapshot

Plain snapshot of [EngineStats].

FieldTypeDescription
jobs_completedrequiredinteger (int64) (min 0)
jobs_createdrequiredinteger (int64) (min 0)
jobs_dead_letteredrequiredinteger (int64) (min 0)
jobs_failedrequiredinteger (int64) (min 0)
jobs_retriedrequiredinteger (int64) (min 0)
workflows_completedrequiredinteger (int64) (min 0)
workflows_createdrequiredinteger (int64) (min 0)
workflows_failedrequiredinteger (int64) (min 0)

#StepCondition

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.

FieldTypeDescription
allarray<StepCondition> | nullTrue when every member is true.
anyarray<StepCondition> | nullTrue when at least one member is true.
notStepCondition | null
opConditionOp | null
pathstring | null
valueobject | null

#StepStatus

Lifecycle state of a single workflow step.

One of "pending", "running", "completed", "failed", "cancelled", "skipped".

#TasksResponse

FieldTypeDescription
tasksrequiredarray<string>

#WhoAmIResponse

The caller's identity, as the server resolved it from the bearer token.

FieldTypeDescription
accessrequiredstringread_write, or read_only for a :ro key or a scope: read JWT.
tenantrequiredstringThe tenant every request with this credential is scoped to.

#Workflow

A workflow instance and its steps.

FieldTypeDescription
created_atrequiredstring (date-time)
idrequiredstring
namerequiredstring
statusrequiredWorkflowStatus
stepsrequiredarray<WorkflowStep>
completed_atstring (date-time) | null
contextobjectAccumulated step results, keyed by step name. Passed to downstream steps under the _context payload key.
deadline_atstring (date-time) | nullWhen the janitor fails the workflow if it is still running (set from timeout_secs; pushed forward by a retry).
error_messagestring | nullWhy the workflow ended failed or cancelled, when known (an upstream failure, a timeout, a user cancel).
metadataobject
parent_step_namestring | nullThe parent's step that spawned this child.
parent_workflow_idstring | nullSet on a child workflow spawned by a sub-workflow step.
retry_countinteger (int32)How many times POST /workflows/{id}/retry re-ran this workflow. (min 0)
started_atstring (date-time) | null
tenant_idstring | null
timeout_secsinteger (int64) | nullThe whole-workflow time budget it was created with, if any. (min 0)

#WorkflowDiagramResponse

FieldTypeDescription
diagramrequiredstringThe diagram document (Mermaid graph TD).
formatrequiredstringDiagram source format. Always mermaid today.

#WorkflowEvent

One status event of the workflow stream: the workflow's status and every step's live state.

FieldTypeDescription
statusrequiredWorkflowStatus
stepsrequiredarray<WorkflowStepState>
workflow_idrequiredstring
error_messagestring | null

#WorkflowStatus

Lifecycle state of a workflow instance.

One of "created", "running", "completed", "failed", "partially_failed", "cancelled".

#WorkflowStep

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.

FieldTypeDescription
namerequiredstring
configJobConfig | null
depends_onarray<string>
fan_outFanOut | nullRun the task once per element of an array in the context.
metadataobject
on_failureOnFailure
on_successOnSuccess
payloadobject
queuestring | nullQueue for this step's job(s); the server's default queue when absent.
task_namestringThe task handler to run. May be omitted for a sub-workflow step.
whenStepCondition | nullRun 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.
workflowCreateWorkflowRequest | nullRun 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.

#WorkflowStepState

Runtime status of one workflow step (the live progress view).

FieldTypeDescription
namerequiredstringThe step's name (its address within the workflow).
statusrequiredStepStatus
child_workflow_idstring | nullThe child workflow of a sub-workflow step, once spawned.
completed_atstring (date-time) | nullWhen the step reached a terminal status.
errorstring | nullWhy the step failed, was skipped (condition not met for a false when) or was cancelled.
fan_outFanOutProgress | nullProgress of a fan-out step's children, once spawned.
job_idstring | nullThe job executing this step, once one has been scheduled (the first child, for a fan-out).
started_atstring (date-time) | nullWhen the step was scheduled (its job or child workflow created).

#WorkflowStepStatesResponse

FieldTypeDescription
stepsrequiredarray<WorkflowStepState>One entry per step, in declaration order.