Skip to main content

SF-0413 · Concept · Easy

Which interface is implemented for Queueable class?

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

A Queueable Apex class implements the System.Queueable interface. The interface has exactly one method: void execute(QueueableContext context).

public class SimpleQueueable implements Queueable {
    public void execute(QueueableContext qc) {
        System.debug('Running queueable job: ' + qc.getJobId());
    }
}

Submit it with System.enqueueJob(new SimpleQueueable()); — that call returns the Id of the resulting AsyncApexJob.

Optional marker interfaces

Depending on what your job needs to do, you can also implement:

InterfacePurpose
Database.AllowsCalloutsRequired to make HTTP callouts from execute()
SchedulableLets the same class be scheduled via System.schedule()
Finalizer (separate class)Run cleanup after the job completes, success or fail
public class CalloutQueueable implements Queueable, Database.AllowsCallouts {
    public void execute(QueueableContext qc) {
        HttpResponse res = new Http().send(buildRequest());
        // ...
    }
    private HttpRequest buildRequest() { return null; }
}

Why Queueable over @future

  • Typed inputs — constructor can take SObjects, custom Apex classes, lists, maps. Future methods only accept primitives.
  • Job IdSystem.enqueueJob returns an Id you can monitor in AsyncApexJob.
  • Chaining — call System.enqueueJob from inside execute() to chain another Queueable (up to 5 deep in production, unlimited in tests).
  • Finalizers — attach a System.Finalizer for post-job cleanup, which future methods can’t do.

Common follow-ups

  • Full namespace?System.Queueable. The System namespace is implicit so implements Queueable works without import.
  • How many can I queue in one transaction? — In a synchronous transaction, up to 50 jobs via enqueueJob. From inside a Queueable, only 1 (the next chained job).

Verified against: Apex Developer Guide — Queueable Apex. Last reviewed 2026-05-17 for Spring ‘26.