Skip to Content

Retrieve Queue

Required accessQueues: readread:queuesAny key with this access, from API keys
GET
/api/v1/queues/{queueParam}

Get a queue by its ID, or by type and name.

Authorization

secretKey
headerAuthorizationBearer <token>

Use a named environment API key. It starts with tr_dev_sk_, tr_prod_sk_, tr_stg_sk_, etc.

Create a named API key in the API Keys section of your Trigger.dev project dashboard. Choose the narrowest access preset that supports your integration.

Our TypeScript SDK will default to using the value of the TRIGGER_SECRET_KEY environment variable if it is set. If you are using the SDK in a different environment, you can set the key using the configure function.

import { configure } from "@trigger.dev/sdk";configure({ accessToken: "tr_dev_sk_1234" });

Path Parameters

queueParam*string

The queue ID (e.g., queue_1234), or the name of the queue when using the type query parameter.

Query Parameters

type?string

How to interpret the queueParam path parameter:

  • id: Treat as a queue ID (default)
  • task: Treat as a task ID to get the task's default queue
  • custom: Treat as a custom queue name
Default"id"
Value in"id""task""custom"

Response Body

Successful request

application/json
  1. response
id*string

The queue ID, e.g., queue_1234

name*string

The queue name. For task queues, this is the task ID. For custom queues, this is the name you specified.

type*string

The type of queue:

  • task: Created automatically for each task
  • custom: Created explicitly in your code using queue()
Value in"task""custom"
version*string

Discriminates the shape:

  • V1: the queue carries its own concurrencyLimit (applied per key when runs pass a concurrencyKey, to the whole queue when they don't) and its concurrency override state
  • V2: the queue is only the line runs wait in; concurrency is declared with the task concurrency option and managed through the concurrency-limits endpoints. concurrencyLimit is always null and concurrency is absent.
Value in"V1""V2"
running*integer

The number of runs currently executing

queued*integer

The number of runs currently queued

paused*boolean

Whether the queue is paused. When paused, no new runs will start.

concurrencyLimit?integer

The queue's own concurrency limit. Meaningful on V1 queues; always null on V2 queues.

concurrency?

Detailed concurrency information. V1 queues only.

Example Request
import { queues } from "@trigger.dev/sdk";// Using queue IDconst queue = await queues.retrieve("queue_1234");// Using type and name for a task queueconst taskQueue = await queues.retrieve({  type: "task",  name: "my-task-id",});// Using type and name for a custom queueconst customQueue = await queues.retrieve({  type: "custom",  name: "my-custom-queue",});
Example Response
{  "id": "queue_1234",  "name": "my-task-id",  "type": "task",  "version": "V1",  "running": 5,  "queued": 10,  "paused": false,  "concurrencyLimit": 10,  "concurrency": {    "current": 10,    "base": 10,    "override": null,    "overriddenAt": null,    "overriddenBy": null  }}

Was this page helpful?

Last updated

Edit on GitHub