Reference
Queues API
List an environment's queues and read one, with its concurrency limit and how many of its runs are running and waiting. An environment API key can call both routes, in its own environment.
On this page
These are the routes the SDKs' queues calls use. They only read: limits are set in the deployment. With an environment API key, every queue is in the key's environment: the environment parameter may be left out, and naming another environment answers 404. For what queues do, see Queues and concurrency limits.
| SDK | Route |
|---|---|
queues.list | GET /v1/queues |
queues.retrieve | GET /v1/queues/{queue} |
The wire format is snake case. The SDKs answer in Trigger.dev's shape instead: concurrencyLimit, plus paused (always false) and concurrency, whose current and base are the limit.
A task's own queue has the ID task/<task id>. Send it URL-encoded, as task%2Femail.send, or send the task ID with ?type=task.
List queues#
GET/v1/queues
Auth: Operator token or Environment API key
An environment's queues, ordered by ID: each task's own queue and every named queue its deployments declared, with the limit the current deployment sets and how many runs execute and wait now. Numbered pages, as Trigger's queues.list({page, perPage}) reads them.
Parameters
| Field | Description |
|---|---|
environmentstring in query | Default: an API key's own environment, else the one the control plane serves. Another than an API key's own, or an unknown one, is a 404. |
pageinteger in query | A numbered page, from 1. A page past the last is empty; its pagination still counts the queues. |
per_pageinteger in query | Queues per page, 1..200. |
Responses
- 200OK
QueuePage - 400The request was invalid: a validation error, or a malformed path, query or JSON body. Extractor rejections (malformed JSON, a bad UUID) carry a text/plain body instead.
Error - 401Missing or wrong bearer token.
Error - 404The resource does not exist.
Error
Fields of QueuePage
| Field | Description |
|---|---|
queuesQueue[] required | |
paginationPagination required |
Get a queue#
GET/v1/queues/{queue}
Auth: Operator token or Environment API key
One queue of an environment, as Trigger's queues.retrieve: by its ID (task/<task id> URL-encoded, or a declared name), or with type=task by a task ID, or type=custom by a declared name. A queue the environment does not have is a 404.
Parameters
| Field | Description |
|---|---|
queuestring in path required | The queue's ID, or a task ID or declared name as type says. |
environmentstring in query | Default: an API key's own environment, else the one the control plane serves. Another than an API key's own, or an unknown one, is a 404. |
type"id" | "task" | "custom" in query | What {queue} is. Anything else is a 400. |
Responses
- 200OK
Queue - 400The request was invalid: a validation error, or a malformed path, query or JSON body. Extractor rejections (malformed JSON, a bad UUID) carry a text/plain body instead.
Error - 401Missing or wrong bearer token.
Error - 404The resource does not exist.
Error
Fields of Queue
| Field | Description |
|---|---|
idstring required | task/<task id> for a task's own queue, or the declared name: what a run's queue holds and a trigger's queue names. |
namestring required | The task ID for a task's own queue, as Trigger.dev names it; the declared name otherwise. |
type"task" | "custom" required | task for a task's own queue, custom for a named one. |
environmentstring required | |
concurrency_limitinteger | null required | At most this many of its runs execute at once, per concurrency key for keyed runs; null for no limit. |
runninginteger required | Its slots in use, over every concurrency key: runs executing (an attempt whose lease lapsed holds its slot until its process is proved stopped) and workflows asleep for under 60 seconds, which keep theirs. Other waits hold none. |
queuedinteger required | Its queued runs. |