A batch job sitting in the Apex Flex Queue has status Holding. As soon as a Processing slot opens up (one of the 5 active jobs completes), the front-of-queue Holding job is promoted to Queued → Preparing → Processing.
The full status lifecycle of a Batch Apex job
Holding → Queued → Preparing → Processing → Completed
→ Failed
→ Aborted
| Status | Where it’s at |
|---|---|
Holding | In the Flex Queue, waiting for an active slot |
Queued | Picked up from the Flex Queue, waiting to start |
Preparing | start method running (building QueryLocator / Iterable) |
Processing | One or more execute chunks running |
Completed | All chunks done, finish ran |
Failed | Hit an uncaught exception or limit |
Aborted | Cancelled by System.abortJob or UI |
Holding is unique to batch jobs in the Flex Queue. Queueable and Future jobs don’t have a Holding state — they go straight to Queued.
Spot Holding jobs
SELECT Id, ApexClass.Name, Status, CreatedDate
FROM AsyncApexJob
WHERE Status = 'Holding' AND JobType = 'BatchApex'
ORDER BY CreatedDate ASC
The first one in the result set is the next to be promoted.
The UI view
Setup → Apex Flex Queue lists only Holding jobs. The list is ordered by queue position, which is initially the order submitted but can be changed via:
- The Reorder buttons in the UI
FlexQueue.moveJobToFront(jobId)(and friends) in Apex
Setup → Apex Jobs shows everything regardless of status.
What Holding means for monitoring
When a user submits a long-running batch, you may want to differentiate “your job is waiting” from “your job is running” in the UI:
public static String userFriendlyStatus(Id jobId) {
AsyncApexJob job = [SELECT Status FROM AsyncApexJob WHERE Id = :jobId];
if (job.Status == 'Holding') return 'Waiting in queue';
if (job.Status == 'Preparing' || job.Status == 'Processing') return 'Running';
if (job.Status == 'Completed') return 'Complete';
if (job.Status == 'Failed' || job.Status == 'Aborted') return 'Stopped';
return job.Status;
}
What you can do to a Holding job
| Action | Works on Holding job? |
|---|---|
Abort (System.abortJob) | Yes |
| Reorder | Yes |
| Move to front | Yes |
| Read details | Yes |
What you can’t do on a Holding job: see chunk progress (none yet), see error messages (none yet), see TotalJobItems (calculated in Preparing).
Common interview follow-ups
- Is
Holdingever used outside batch? — No — only batch jobs in the Flex Queue. - Why isn’t
Holdingdocumented for Queueable? — Queueable doesn’t use the Flex Queue. Its concurrency is governed by the daily async limit. - How long can a job stay in Holding? — As long as the queue is busy. Could be seconds, minutes, or never (if you’ve truly exceeded capacity continuously).
Verified against: Apex Developer Guide — Monitoring Asynchronous Apex. Last reviewed 2026-05-17.