Override Concurrency Limit
Override the concurrency limit of a queue. This is useful for temporarily scaling up or down based on demand.
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"concurrencyLimit*integerThe new concurrency limit to set for the queue. It may not exceed your environment's maximum concurrency limit: a higher value is rejected with a 400, not capped to the maximum.
0 <= value <= 100000Concurrency limit overridden 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";// Override concurrency limit to 5await queues.overrideConcurrencyLimit("queue_1234", 5);// Using type and nameawait queues.overrideConcurrencyLimit( { type: "task", name: "my-task-id" }, 20);{ "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