Pause or Resume Queue
Pause a queue to prevent new runs from starting, or resume a paused queue. Runs that are currently executing will continue to completion.
secretKeyAuthorizationBearer <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" });queueParam*stringThe queue ID (e.g., queue_1234), or the name of the queue when using the type body parameter.
application/json- body
type?stringHow 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 queuecustom: Treat as a custom queue name
"id""id""task""custom"action*stringWhether to pause or resume the queue
"pause""resume"Queue paused or resumed successfully
application/json- response
id*stringThe queue ID, e.g., queue_1234
name*stringThe queue name. For task queues, this is the task ID. For custom queues, this is the name you specified.
type*stringThe type of queue:
task: Created automatically for each taskcustom: Created explicitly in your code usingqueue()
"task""custom"version*stringDiscriminates the shape:
V1: the queue carries its ownconcurrencyLimit(applied per key when runs pass aconcurrencyKey, to the whole queue when they don't) and itsconcurrencyoverride stateV2: the queue is only the line runs wait in; concurrency is declared with the taskconcurrencyoption and managed through the concurrency-limits endpoints.concurrencyLimitis always null andconcurrencyis absent.
"V1""V2"running*integerThe number of runs currently executing
queued*integerThe number of runs currently queued
paused*booleanWhether the queue is paused. When paused, no new runs will start.
concurrencyLimit?integerThe queue's own concurrency limit. Meaningful on V1 queues; always null on V2 queues.
concurrency?Detailed concurrency information. V1 queues only.
import { queues } from "@trigger.dev/sdk";// Pause a queueawait queues.pause("queue_1234");await queues.pause({ type: "task", name: "my-task-id" });// Resume a queueawait queues.resume("queue_1234");await queues.resume({ type: "task", name: "my-task-id" });{ "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