Override Concurrency Limit
Override a concurrency limit's bounds. Only the given fields change; the declared
values are kept and restored by reset. To stop runs holding a limit, prefer the
pause endpoint (it keeps the configured bounds); overriding total to 0 also
blocks every run holding the limit.
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" });name*stringThe limit's name
application/json- body
Override the limit itself. At least one of perKey or total must be provided.
1 <= propertiesperKey?integerCaps each concurrencyKey pool; runs without a key share one pool. May not exceed the environment concurrency limit.
0 <= value <= 100000total?integerCaps every run holding this limit, keys or not. May not exceed the environment concurrency limit.
0 <= value <= 100000Concurrency limit overridden successfully
application/json- response
id*stringThe limit's id, starting with climit_
name*stringThe limit's name, as declared with concurrencyLimit()
perKey*Caps each concurrencyKey pool; runs without a key share one pool
total*Caps every run holding this limit, keys or not
running*integerRuns executing that hold this limit
queued*integerRuns that are queued and must clear this limit to execute
paused?booleanWhether the limit is paused. A paused limit admits no runs until resumed; its configured bounds are kept.
import { concurrencyLimits } from "@trigger.dev/sdk";// Raise the shared capawait concurrencyLimits.override("openai", { total: 50 });{ "id": "climit_abcdef123456", "name": "openai", "perKey": { "current": null, "base": null, "override": null, "overriddenAt": null }, "total": { "current": 25, "base": 25, "override": null, "overriddenAt": null }, "running": 14, "queued": 100, "paused": false}Was this page helpful?
Last updated
Edit on GitHub