# Choosing Queueable, Batch, Scheduled or future Apex

*Platform Developer II Study Guide · Process Automation, Logic, and Integration · Last updated October 16, 2026 · https://www.certifyforce.com/study-guide/platform-developer-ii/process-automation-logic-and-integration/choosing-queueable-batch-scheduled-or-future-apex*

The advanced async decisions PD II tests: why Queueable replaces future methods, bulk-safe enqueueing from triggers, Database.Stateful and callouts in Batch Apex, callouts from Scheduled Apex, transaction finalizers, and async as the fix for mixed DML and slow saves.

- Certification: Salesforce Platform Developer II
- Exam section: Process Automation, Logic, and Integration
- Study guide: https://www.certifyforce.com/study-guide/platform-developer-ii

**Official exam objective:**

> Analyze a set of requirements and determine the benefits of using asynchronous Apex coding.

## What the exam expects

- Name what asynchronous Apex gives a requirement (a save that no longer waits, higher limits, scalability) and what it does not (a guaranteed start time).
- Replace a future method with Queueable Apex when the job needs sObjects, a job ID, chaining or callouts, and spot code that will not compile.
- Read a trigger or batch class and find the async bug: too many `System.enqueueJob` calls, state lost between `execute` calls, a callout from the wrong context.
- Design failure recovery for a Queueable job with a transaction finalizer.
- Fix a mixed DML error by moving setup-object DML into an asynchronous job.

The per-transaction limits and the basic future/Queueable/Batch/Scheduled overview are covered in the Platform Developer guide's *Governor limits and asynchronous Apex*; this unit teaches the layer above it.

Key terms: **Queueable** (a class implementing `Queueable`, added to the queue with `System.enqueueJob`), **chaining** (a running job enqueuing the next one), **`Database.Stateful`** (keeps instance variables across batch transactions), **`Database.AllowsCallouts`** (marker interface that permits callouts in Queueable and Batch Apex), **transaction finalizer** (a `System.Finalizer` attached to a Queueable job that runs after it succeeds or fails).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Future method signature | Static, void; parameters are primitives or arrays/collections of primitives | [Future Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm) |
| Queueable extras | Job ID, non-primitive member variables, chaining | [Queueable Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm) |
| Chaining | One child job per executing job; depth 5 in Developer and Trial orgs | [Queueable Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm) |
| enqueueJob per transaction | 50 synchronous, 1 asynchronous, 50 for Bulk API | [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) |
| Rolled-back enqueuing transaction | Queued jobs are not processed | [Queueable Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm) |
| QueryLocator | Up to 50 million records; scope default 200, maximum 2,000 | [Use Batch Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm) |
| Database.Stateful | Keeps instance variables; statics still reset | [Use Batch Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm) |
| Batch concurrency | Up to 5 queued or active jobs; flex queue holds 100 | [Use Batch Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm) |
| Scheduled Apex | 100 jobs at once; no synchronous callouts | [Apex Scheduler](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm) |
| Finalizer retries | Re-enqueue up to 5 consecutive failures; one async job per finalizer | [Transaction Finalizers](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_transaction_finalizers.htm) |
| Daily async allowance | 250,000 or 200 × user licenses, whichever is greater | [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) |

## Check yourself

- Why does a future method reject an sObject parameter?
- When does a batch class need `Database.Stateful`?
- When must a scheduled job hand its callout to another class?
- What happens to a Queueable enqueued by a transaction that later rolls back?

## Sources

- [Queueable Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm)
- [Transaction Finalizers](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_transaction_finalizers.htm)
- [Use Batch Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm)
- [Apex Scheduler](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm)
- [Future Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm)
- [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm)
- [Asynchronous Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_async_overview.htm)
- [sObjects That Can't Be Used Together in DML Operations](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_non_mix_sobjects.htm)
- [Understanding Asynchronous Processing in Salesforce](https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_introduction)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 9 linked practice questions, and unlimited timed mock exams are included with the Platform Developer II pack (USD $19): https://www.certifyforce.com/practice-exams
