The Apex Flex Queue holds up to 100 batch jobs in Holding status. Combined with the 5 jobs that can be Processing (active) at once, a single Salesforce org can have up to 105 batch jobs queued simultaneously waiting their turn.
The numbers
| State | Limit | Description |
|---|---|---|
Holding (in Flex Queue) | 100 | Waiting for an active slot |
Processing (active) | 5 | Currently running |
| Total simultaneous batch jobs | 105 | Holding + Processing |
Try to submit a 106th batch via Database.executeBatch and you get:
System.LimitException: Attempt to add a job to the apex flex queue failed because the queue is full.
How jobs flow through
Database.executeBatch(new MyBatch())is called.- If fewer than 5 batches are
Processing, your job goes straight toProcessing. - Otherwise, it goes to the Flex Queue with status
Holding. - When a
Processingjob completes, the front of the Flex Queue is promoted toProcessing. - The queue is FIFO by default — first in, first out — but you can reorder it via Setup or
FlexQueueApex APIs.
Where you see it
Setup → Apex Flex Queue lists all Holding jobs in order. You can:
- View each job’s class and submitted date
- Reorder positions (move up/down/top/bottom)
- Abort individual
Holdingjobs
The Apex Flex Queue page is sibling to (but distinct from) Setup → Apex Jobs, which shows everything regardless of status.
Programmatic queue management
// Get a specific job's position
Boolean moved = FlexQueue.moveJobToFront(jobId);
Boolean back = FlexQueue.moveJobToEnd(jobId);
Boolean above = FlexQueue.moveBeforeJob(jobId, otherJobId);
Boolean below = FlexQueue.moveAfterJob(jobId, otherJobId);
Each returns true on success. Reordering only affects Holding jobs — once Processing, the order is fixed.
What the limit applies to
| Job type | Counts against Flex Queue? |
|---|---|
Batch Apex (Database.executeBatch) | Yes |
Queueable (System.enqueueJob) | No (different queue) |
Scheduled Apex (System.schedule) | No (different limit) |
| Future methods | No (different limit) |
Only batch uses the Flex Queue.
Common interview follow-ups
- What if I submit job #106? —
LimitException: Apex Flex Queue is full. - Can the limit be raised? — No, it’s a fixed platform limit.
- Why is the limit not visible in
Limitsclass? — The Flex Queue limit is org-wide, not per-transaction;Limits.getQueueableJobsis for the per-transaction Queueable cap (50).
Verified against: Apex Developer Guide — Apex Flex Queue. Last reviewed 2026-05-17.