Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DictionaryAApex Flex Queue
DevelopmentAdvanced

Apex Flex Queue

Apex Flex Queue is a Setup page that displays batch Apex jobs that are waiting in the flex queue before being processed.

§ 01

Definition

Apex Flex Queue is a Setup page that displays batch Apex jobs that are waiting in the flex queue before being processed. The flex queue holds up to 100 batch jobs in a "Holding" status when the system's five concurrent batch processing slots are full. Administrators can reorder jobs in the queue to prioritize critical batch processes.

§ 02

In plain English

👋 Study buddy

Here's a simple way to think about it: Apex Flex Queue is the waiting room for batch jobs. Salesforce only runs five batch jobs at once; the rest wait here in line. You can see what's queued and reorder priorities - push the urgent batch ahead of the routine ones.

§ 03

Worked example

scenario · real-world use

At DataSync Corp, multiple batch jobs run overnight for data cleanup, report generation, and email sends. The admin opens the Apex Flex Queue and sees eight jobs waiting. She moves the critical data quality batch job to the top of the queue so it processes first, ensuring clean data is available for the morning reports.

§ 04

Why Apex Flex Queue is where batch jobs wait their turn in line

Salesforce processes only five concurrent batch Apex jobs at a time. Jobs submitted past that limit go into the Flex Queue, holding in a queued state until a slot opens. Apex Flex Queue is the page that shows you what's waiting, in what order, and lets you reorder priorities - push a critical batch ahead of less-urgent jobs without canceling and resubmitting.

The reason this matters past simple visibility is that the Flex Queue is finite - 100 jobs max. An org that submits batch jobs faster than they execute will eventually hit that ceiling, and new submissions will fail rather than queue. Watch the page during periods of heavy batch activity (end-of-month aggregations, mass imports, scheduled cleanups), and design batch architectures with the concurrency limit and queue depth in mind from the start.

§ 05

How to set up Apex Flex Queue

Apex Flex Queue is the read-only management page for batch Apex jobs waiting to start — Salesforce processes 5 batch jobs concurrently per org, and any beyond that wait in Holding status in the Flex Queue (up to 100 jobs). Admins can reorder the queue to prioritize critical jobs.

  1. Open Setup → Apex Flex Queue

    Setup gear → Quick Find: Apex Flex Queue → Apex Flex Queue.

  2. Review jobs in Holding status

    Each row: Job ID, Apex Class, Submitted Date, Position in Queue.

  3. Reorder by clicking Move to Front / Move to Back

    Higher-priority jobs to the front. Salesforce takes from position 1 when a slot frees.

  4. For job abort: click Abort on Holding jobs

    Aborts before the job starts. Once a job moves out of Holding into Processing, abort happens via Apex Jobs page instead.

  5. Monitor concurrent execution via Apex Jobs

    Setup → Apex Jobs shows in-flight batch jobs (Status = Processing). Flex Queue is the waiting room.

Key options
Move to Front / Move to Backremember

Reorder priority of jobs in Holding.

Abortremember

Cancel a Holding job before it starts.

Position in Queueremember

Read-only column showing current ordering.

Gotchas
  • 5 concurrent batch jobs is a hard org-wide limit. Submitting 6+ jobs queues the extras in Holding — they wait for a slot to free.
  • 100 jobs max in the Flex Queue. Submitting a 101st batch fails with a System.AsyncException — your code must handle this case.
  • Reordering only affects Holding jobs. Once a job starts (Processing status), it can't be paused or reordered — it runs to completion or abort.
§ 06

How organizations use Apex Flex Queue

Atlas Manufacturing

End-of-month batch jobs queue up in the Flex Queue; admins reorder them so the financial reconciliation runs before downstream reports that depend on it.

Lighthouse Health

Migration team monitors Flex Queue depth during big data loads; when queue length grows past 50, the team throttles incoming integrations to prevent the 100-job ceiling.

Northwind Trading

Operations team uses Flex Queue ordering during incident response - pushing urgent recovery batches ahead of routine sharing recalculations.

§

Trust & references

Official documentation

Straight from the source - Salesforce's reference material on Apex Flex Queue.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.
§

Test your knowledge

Q1. What skill set is typically needed to work with Apex Flex Queue?

Q2. Where would a developer typically work with Apex Flex Queue?

Q3. What is a Governor Limit in the context of Apex Flex Queue?

§

Discussion

Loading…

Loading discussion…