Yes — but only for jobs with status Holding (in the Flex Queue). Once a job is Processing, its position is fixed.
Two ways to reorder:
- Apex
FlexQueueclass — programmatic, deterministic. - Setup → Apex Flex Queue UI — manual, point-and-click.
The FlexQueue API
// Move to the front of the queue (next to be promoted)
Boolean ok = FlexQueue.moveJobToFront(jobId);
// Move to the end (lowest priority)
Boolean ok = FlexQueue.moveJobToEnd(jobId);
// Position relative to another job
Boolean ok = FlexQueue.moveBeforeJob(thisJobId, otherJobId);
Boolean ok = FlexQueue.moveAfterJob(thisJobId, otherJobId);
Each returns true if the move succeeded, false if either job wasn’t in Holding status (already running, completed, or not in the queue).
Practical example
A nightly cleanup batch needs to run before a daytime sync batch when they overlap:
public class BatchPrioritizer {
public static void prioritizeCleanup() {
List<AsyncApexJob> holding = [
SELECT Id, ApexClass.Name FROM AsyncApexJob
WHERE Status = 'Holding' AND JobType = 'BatchApex'
];
Id cleanupJobId = null;
for (AsyncApexJob j : holding) {
if (j.ApexClass.Name == 'NightlyCleanupBatch') {
cleanupJobId = j.Id;
break;
}
}
if (cleanupJobId != null) {
FlexQueue.moveJobToFront(cleanupJobId);
}
}
}
The UI
Setup → Apex Flex Queue shows the queue in order. Each row has buttons to move up, down, top, or bottom. Quick for one-off intervention; not scalable.
What can’t be moved
| Status | Can reorder? |
|---|---|
Holding | Yes |
Queued | No (already promoted) |
Preparing | No |
Processing | No |
Completed, Failed, Aborted | No (terminal) |
When this is useful
- Priority jobs — a customer-impacting batch should jump ahead of a cosmetic cleanup batch.
- Dependency ordering — batch B depends on batch A; if both are Holding, put A first.
- Triage — during a slow processing day, manually order the queue to handle urgent customers first.
When NOT to use this
- Don’t reorder constantly — it adds operational overhead, and the platform’s FIFO default is usually fine.
- Don’t reorder for fairness — if you have 100 jobs Holding, picking favorites just delays everyone else proportionally.
- Don’t reorder instead of fixing capacity — if you’re constantly hitting the queue cap, the answer is fewer/larger batches or refactoring to Queueable, not reordering.
Common interview follow-ups
- Can I reorder Queueable jobs? — No. Queueable doesn’t use the Flex Queue.
- Can I reorder scheduled jobs? — No. Scheduled jobs run on their cron; you change the schedule, not the queue.
- What permissions are needed? — Same as for invoking Apex — typically API access. To use the UI, you also need Setup access.
Verified against: Apex Developer Guide — FlexQueue Class. Last reviewed 2026-05-17.