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.