Skip to main content

SF-0360 · Scenario · Medium

Can we trace or track the execution of future methods?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026 · Updated for Spring '26

Yes. Every future method invocation creates an AsyncApexJob record. You can monitor execution via the Apex Jobs page in Setup, or query the records directly in SOQL.

In the UI

Setup → Apex Jobs lists every async invocation:

  • Job TypeFuture, BatchApex, Queueable, ScheduledApex
  • StatusQueued, Preparing, Processing, Completed, Failed, Aborted
  • Submitted Date, Completed Date — durations
  • Apex Class — the class that contains the future
  • Method Name — for futures specifically

This is the first place to look when a future seems to “not run.”

In SOQL

SELECT Id, ApexClass.Name, MethodName, Status, JobType,
       NumberOfErrors, ExtendedStatus, CreatedDate, CompletedDate
FROM AsyncApexJob
WHERE JobType = 'Future'
  AND CreatedDate = TODAY
ORDER BY CreatedDate DESC

What each field tells you:

FieldMeaning
StatusWhere it is in the lifecycle
JobTypeFuture, BatchApex, Queueable, ScheduledApex
NumberOfErrorsCount of failed records or chunks
ExtendedStatusThe exception message if it failed
MethodNameThe exact @future method name
ApexClass.NameThe class containing the method
CreatedDateWhen it was enqueued
CompletedDateWhen it finished (or null if still running)

Programmatically while a job runs

If you stored the JobId from a Queueable, you can poll for status:

public static String checkStatus(Id jobId) {
    AsyncApexJob job = [SELECT Status, NumberOfErrors, ExtendedStatus
                        FROM AsyncApexJob WHERE Id = :jobId];
    return job.Status + (job.NumberOfErrors > 0 ? ' (errors: ' + job.NumberOfErrors + ')' : '');
}

Note: future methods don’t return a JobId to the caller — there’s no equivalent of System.enqueueJob’s return value. To find a specific future’s record, you have to filter on MethodName, ApexClass.Name, and CreatedDate.

Debug logs

Each future runs in its own transaction with its own debug log entry. Enable a trace flag for the running user (or Automated Process for system-scheduled work), then re-run the trigger. The future’s log appears separately a few seconds later.

Email on failure

When a future method fails with an uncaught exception, Salesforce emails the apex exception email recipients (Setup → Apex Exception Email). Subject: “Developer script exception from MyOrg : YourClass.yourMethod : YourClass.”

Limits worth knowing

LimitValue
AsyncApexJob retention7 days for completed jobs, then deleted
Future calls per 24 hours250,000 or 200 × user licenses
Queued + active jobs (org-wide)Same daily async limit

If you need long-term tracking, write your own log record from inside the future method — AsyncApexJob is not a long-term audit log.

Common interview follow-ups

  • Can I cancel a queued future? — Sort of. System.abortJob(jobId) works on Scheduled, Batch, and Queueable. Future cancellation isn’t really supported through Apex.
  • Why does my future never appear? — Either the trigger never called it (check System.isBatch() guards), or the future is in Queued status waiting for capacity, or ExtendedStatus says it failed before starting.
  • Can I see the parameters that were passed? — Not from AsyncApexJob. Log them yourself if you need that.

Verified against: Apex Developer Guide — Monitoring Asynchronous Apex. Last reviewed 2026-05-17.