Skip to content

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.

SDKRoute
queues.listGET /v1/queues
queues.retrieveGET /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

List queues: parameters
FieldDescription
environmentstring in queryDefault: 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 queryA numbered page, from 1. A page past the last is empty; its pagination still counts the queues.
per_pageinteger in queryQueues 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
QueuePage fields
FieldDescription
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

Get a queue: parameters
FieldDescription
queuestring in path requiredThe queue's ID, or a task ID or declared name as type says.
environmentstring in queryDefault: 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 queryWhat {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
Queue fields
FieldDescription
idstring requiredtask/<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 requiredThe task ID for a task's own queue, as Trigger.dev names it; the declared name otherwise.
type"task" | "custom" requiredtask for a task's own queue, custom for a named one.
environmentstring required
concurrency_limitinteger | null requiredAt most this many of its runs execute at once, per concurrency key for keyed runs; null for no limit.
runninginteger requiredIts 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 requiredIts queued runs.