Loading

Proactive Alert Monitoring: Apex Flex Queue Limit

Fecha de publicación: Aug 7, 2026
Descripción

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.

 

Solución

Causes

  • 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.


Resolution

Reducing Queue Saturation

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.

Optimizing Batch Size and 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.

Managing Batch Job Scheduling

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.

 

Recursos adicionales

Additional Resources

Help and Developer Resources

Useful Trails

Número del artículo de conocimiento

005388770

 
Cargando
Salesforce Help | Article