Apex Jobs
Apex Jobs is the Salesforce Setup page that monitors every asynchronous Apex execution in the org: batch Apex, scheduled Apex, Future methods, and Queueable jobs.
Definition
Apex Jobs is the Salesforce Setup page that monitors every asynchronous Apex execution in the org: batch Apex, scheduled Apex, Future methods, and Queueable jobs. The page lives at Setup, Environments, Jobs, Apex Jobs and lists each job with its submitter, status (Holding, Queued, Preparing, Processing, Completed, Failed, Aborted), total batches processed, errors, start time, and elapsed time. For an admin investigating why an automation did not fire or a developer debugging a slow batch class, Apex Jobs is the first place to look. It is the operational dashboard for async Apex.
The Apex Jobs page is backed by the AsyncApexJob standard object, which is queryable through SOQL. The same data flows into the Apex Flex Queue page (which scopes to Holding status), into custom monitoring dashboards built on AsyncApexJob, and into Setup, Scheduled Jobs (which scopes to cron-driven jobs). Most production orgs build a dashboard or report on top of AsyncApexJob to surface failure trends, average run times, and stuck jobs across the entire async surface, since one Setup page rarely keeps up with the operational scale of a busy org.
How the Apex Jobs page exposes the async layer
Which jobs appear on the page
Apex Jobs lists Batch Apex, Future method calls, Queueable Apex, and Scheduled Apex executions. Synchronous Apex (a trigger, a controller method, a regular class call) does not appear; the page is async-only. The combined view is helpful precisely because a process can hop between these surfaces (a trigger queues a Future, the Future enqueues a Queueable, the Queueable launches a batch); the page lets you trace the whole chain.
The status lifecycle
Every async job moves through statuses: Holding (waiting in the Flex Queue), Queued (slot open, about to start), Preparing (start method running for batch), Processing (executing batches), Completed (success), Failed (uncaught exception), Aborted (cancelled). The status column on Apex Jobs is the fastest way to triage what is happening right now. Failed and Aborted are the statuses worth alerting on; Completed without batches processed often signals a silent data issue.
Total Batches, Batches Processed, and Failures
Batch Apex jobs expose three numeric columns. Total Batches is the count Salesforce calculated at start time based on the QueryLocator. Batches Processed is the running count. Failures counts batches where the execute method threw. A Completed job with Failures > 0 means some batches succeeded and others did not; the partial success model is unique to batch and surprises developers who expect all-or-nothing behaviour.
Drilling into a specific job
Clicking a job opens its detail page with submission timestamp, apex class, scope size, completed and failed batches, and the most recent error message. The View All Errors link surfaces every exception across every failed batch. For batch failures with a representative pattern (one bad record breaking 50 batches), this is the page to read first.
Scheduled Apex versus Apex Jobs
Scheduled Apex shows up on two pages: Setup, Scheduled Jobs lists the cron-style registration (Daily Cleanup at 3 a.m., Quarterly Forecast Reset), while Apex Jobs shows the actual executions that those schedules produced. A scheduled job that never fires shows up on Scheduled Jobs but produces zero rows on Apex Jobs. The two views together expose schedule-versus-execution mismatches that one view alone cannot.
Querying AsyncApexJob in SOQL
SELECT Id, JobType, Status, NumberOfErrors, TotalJobItems, JobItemsProcessed, CompletedDate FROM AsyncApexJob WHERE CreatedDate = TODAY is the canonical health query. The object is queryable, includes references to the submitting user, and joins to the ApexClass that ran. Most production health dashboards sit on top of this query, refreshed every few minutes.
Common patterns and what they mean
Five patterns recur. Stuck in Holding for hours: the Flex Queue is saturated; investigate submission volume. Completed with zero batches: the start query returned no rows; the data filter is wrong or the source is empty. Failed with the same error repeating: a deterministic bug in the execute method. Long elapsed time on small batches: callouts or governor-limit work in the execute method. Many short-lived Future calls: a poorly-bulkified trigger. Each pattern points at a different fix.
Retention and historical access
Apex Jobs retains data for roughly 7 to 30 days depending on volume. Long-term history requires copying AsyncApexJob rows into a custom object on a schedule. Most regulated industries (financial services, healthcare) build that retention pipeline once and forget about it; the alternative is losing forensic data on incidents older than a month.
How to use Apex Jobs for production monitoring
Apex Jobs is the first stop for any async failure investigation. Tuning monitoring on top of it is the work that turns a reactive admin role into a proactive one.
- Open Apex Jobs
Setup, Environments, Jobs, Apex Jobs. Filter by Status to focus on Failed or Processing depending on the question.
- Inspect a specific job
Click the job to see scope size, total batches, error counts, and the most recent error message. View All Errors lists every exception across every failed batch.
- Query AsyncApexJob via SOQL
Use the Developer Console or a Workbench query to pull arbitrary slices: failures by class, average elapsed time per class, queue saturation by hour.
- Build a dashboard
Create a custom report type backed by AsyncApexJob and assemble a dashboard with failure trends, run-time outliers, and current queue depth.
- Snapshot data for long-term retention
Schedule an Apex job that copies AsyncApexJob rows into a custom Async_Job_History object daily. Salesforce retains the source for weeks; the snapshot keeps the audit trail beyond that.
- Apex Jobs retains rows for weeks, not forever. Build a snapshot pipeline if compliance requires longer-term history.
- Completed status does not imply success. A batch can complete with failed batches inside it; check NumberOfErrors before declaring victory.
- Cancelling a job from the page aborts the next batches but does not roll back finished batches. Plan compensating logic separately.
- Scheduled jobs only appear in Apex Jobs after they execute. A misconfigured schedule that never fires shows zero history; check Scheduled Jobs to verify the registration.
Trust & references
Cross-checked against the following references.
- Monitor Apex JobsSalesforce Help
- AsyncApexJob API ReferenceSalesforce Developer Docs
Straight from the source - Salesforce's reference material on Apex Jobs.
- Batch ApexApex Developer Guide
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. Where would a developer typically work with Apex Jobs?
Q2. What is required before deploying Apex Jobs-related code to production?
Q3. What is a Governor Limit in the context of Apex Jobs?
Discussion
Loading discussion…