const concurrencyLimit = client.defineConcurrencyLimit({
  id: `test-shared`,
  limit: 5, // Limit all jobs in this group to 5 concurrent executions
});

client.defineJob({
  id: `test-job-1`,
  name: `Test Job 1`,
  version: "1.0.0",
  trigger: eventTrigger({
    name: "test",
  }),
  concurrencyLimit,
});

client.defineJob({
  id: `test-job-2`,
  name: `Test Job 2`,
  version: "1.0.0",
  trigger: eventTrigger({
    name: "test",
  }),
  concurrencyLimit,
});

You can control the concurrency of run executions for a group of jobs using a concurrency limit group.

Parameters

id
string
required

The ID of the concurrency limit group.

limit
number
required

The maximum number of concurrent executions allowed for this group.