Skip to Content

Pause or Resume Concurrency Limit

Required accessQueues: writewrite:queuesAny key with this access, from API keys
POST
/api/v1/concurrency-limits/{name}/pause

Pause a concurrency limit to prevent runs holding it from starting, or resume a paused limit. Runs that are currently executing will continue to completion, and the limit's configured bounds are kept.

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

name*string

The limit's name

Request Body

application/json
  1. body
action*string

Whether to pause or resume the limit

Value in"pause""resume"

Response Body

Concurrency limit paused or resumed successfully

application/json
  1. response
id*string

The limit's id, starting with climit_

name*string

The 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*integer

Runs executing that hold this limit

queued*integer

Runs that are queued and must clear this limit to execute

paused?boolean

Whether the limit is paused. A paused limit admits no runs until resumed; its configured bounds are kept.

Example Request
import { concurrencyLimits } from "@trigger.dev/sdk";// Pause the limitawait concurrencyLimits.pause("openai");// Resume the limitawait concurrencyLimits.resume("openai");
Example Response
{  "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