Skip to Content
Runlane
Understand Runlane

Queues and concurrency

Route tasks and limit how many can run at once.

A Runlane queue gives tasks a route and an execution policy. Producers, workers, maintenance, and transport runtimes must register the same definition.

With a polling lane, workers filter stored work by queue. With SQS, the lane binds that queue to a provider URL. A similar SQS name cannot replace the shared Runlane definition. Each run stores its logical queue name.

Two settings control different limits

SettingWhat it limitsWhere it applies
Worker concurrencyAttempts running in one processOne worker process
Queue concurrencyCapacity shared by all workersStorage, across the environment

Use worker concurrency to tune local fan-out. Use queue concurrency when several processes must respect the same limit.

Partition capacity with a key

concurrency.total caps reserved and active work across the whole queue. concurrency.perKey caps each concurrency key. A queue can declare either bound or both. For example, { total: 20, perKey: 2 } allows at most 20 owners in total and at most two for each account.

A run acquires one slot in every declared pool atomically. Missing keys share one tagged unkeyed pool when perKey is declared. That pool cannot collide with a caller's string. A key on a total-only queue can still select ordering or a FIFO group, without creating a separate capacity allowance.

Queued work can reserve capacity before execution. Active work holds capacity through its lease. Release, terminal completion, or bounded expired-owner reclamation frees the slots. Worker concurrency remains an independent process limit.

Queue operations pause new admission or temporarily change a declared bound across runtimes. Lower limits let current attempts finish; they never hide high-numbered slots or kill owners.

Ordering is separate

Provider ordering and Runlane concurrency solve different problems. FIFO delivery can order messages within its provider partition. Storage still decides whether a run can execute and whether its Runlane capacity partition is full.

A bounded queue can opt into priority with priorityBoost. Priority helps recent urgent work obtain the next available slot while limiting how long it can overtake older work. It does not create extra capacity or change when a run becomes due. Low-priority work can start immediately on an idle queue.

This is storage admission order, not transport delivery order. Before reserving transport candidates or claiming continued bounded polling candidates, Runlane checks the advisory head for their key and priority. An already-visible backdated run takes precedence. An insertion committed during the reservation transaction can still lose order once; stale indexes can delay discovery. This does not promise global FIFO order. See priority for the comparison rule, replay behavior, and upgrade requirements.

Follow limit concurrency to configure both controls. Use choose a lane to pick the delivery setup.

On this page