The Apex Flex Queue holds batch jobs that are waiting to be processed. It has a hard limit of 100 jobs at any given time. When this limit is reached, any new batch job submissions will fail — blocking all asynchronous batch processing, including business-critical scheduled batch jobs. With the Signature Success plan’s Proactive Monitoring, Salesforce proactively monitors Apex Flex Queue utilization in your organization and alerts you when the queue is approaching or has reached capacity, giving you time to optimize batch job scheduling before failures occur. In addition, on the Salesforce Help site Designated contacts and above can see your realtime metrics, alerts & more.
Excessive batch job submissions — Too many batch jobs submitted in a short period saturate the flex queue before existing jobs can complete.
Zero-record or single-record batch executions — Batch jobs that process zero or very few records still occupy queue slots, wasting capacity and keeping the queue saturated longer than necessary.
Batch size set to 1 — Using a batch size of 1 results in excessive job executions that occupy the 5 concurrent execution slots for longer periods, slowing queue throughput.
Long-running batch jobs — Jobs that run for extended durations hold the limited concurrent execution slots, causing queued jobs to accumulate.
Lack of pre-submission checks — Batch jobs submitted without checking whether there are records to process contribute unnecessary entries to the queue.
Review your batch Apex jobs for common anti-patterns that unnecessarily consume queue capacity. Add pre-checks before calling Database.executeBatch() to verify that records exist to process, avoiding zero-record job submissions. Review the Batch Apex Developer Guide for guidance on efficient batch job design.
Avoid setting batch size to 1 for operations that do not require single-record processing. Use a larger batch size to process more records per execution, reducing the total number of jobs in the queue. For single-record processing use cases, consider replacing batch jobs with Queueable Apex, which is better suited to lightweight, single-item operations.
Review the frequency at which batch jobs are scheduled and consider staggering submissions to avoid simultaneous queue saturation. Use the Apex Flex Queue documentation to understand how to manage and monitor queued jobs programmatically.
005388770

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.