# Continuations for long-running asynchronous callouts

*Platform Developer II Study Guide · Performance · Last updated October 16, 2026 · https://www.certifyforce.com/study-guide/platform-developer-ii/performance/continuations-for-long-running-asynchronous-callouts*

When and how to use the Apex Continuation class from LWC, Aura and Visualforce: background actions that don't block others, up to three parallel or chained callouts, the 120-second continuation timeout, no DML before the callback, and the 80 KB Visualforce controller-state limit.

- Certification: Salesforce Platform Developer II
- Exam section: Performance
- Study guide: https://www.certifyforce.com/study-guide/platform-developer-ii

**Official exam objective:**

> Analyze a scenario and determine performance improvements that can be achieved with an asynchronous callout.

## What the exam expects

- Explain the performance benefit of a continuation over a synchronous callout from a Lightning component or Visualforce page, using current (post-Winter '20) limit rules.
- Choose parallel callouts in one continuation versus chained continuations from whether the requests depend on each other.
- Wire a continuation correctly: `@AuraEnabled(continuation=true)`, the `@salesforce/apexContinuation` import, the callback and `cacheable` rules.
- Diagnose failures: DML before the callout, status code 2000 timeouts, ignored `HttpRequest` timeouts and Visualforce controller-state overflow.

Key terms: **continuation** (an asynchronous callout from a Visualforce page or Lightning component whose response returns through a callback), **callback method** (the method named by `continuationMethod` that processes the responses), **boxcar'ing** (the framework batching several actions into one request), **request label** (the string `addHttpRequest()` returns to identify a request), **controller state** (the serialized Visualforce controllers a continuation carries).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Parallel callouts per continuation | 3 | [Asynchronous Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_limits.htm) |
| Chained callouts | 3 | [Asynchronous Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_limits.htm) |
| Continuation timeout | Maximum 120 seconds; `HttpRequest` timeouts ignored | [Continuation Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Continuation.htm) |
| Visualforce controller state | 80 KB, separate from 170 KB view state | [Asynchronous Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_limits.htm) |
| HTTP response size | 1 MB maximum | [Asynchronous Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_limits.htm) |
| Status code 2000 | Timeout reached before the server responded | [Continuation Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Continuation.htm) |
| Callback transaction | New transaction; all limits reset | [Asynchronous Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_limits.htm) |
| Long-running request limit | All callouts excluded since Winter '20 | [Make Long-Running Callouts with Continuations (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations.html) |
| LWC import scope | `@salesforce/apexContinuation/Class.method` | [Continuation Example (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations-component-example.html) |
| Client concurrency | One continuation in progress at a time | [Continuation Limits (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations-limits.html) |
| DML | Not in the method returning the Continuation; allowed in the callback | [Continuation Limits (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations-limits.html) |

## Check yourself

- Why do continuations still help after Winter '20 if all callouts are excluded from the long-running request limit?
- When should you chain continuations instead of adding requests to one continuation?
- What does status code 2000 from `Continuation.getResponse()` mean?
- Why can a Visualforce continuation fail on state size even when view state is under 170 KB?
- Which two declarations does an LWC continuation need?

## Sources

- [Make Long-Running Callouts with Continuations (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations.html)
- [Make Long-Running Callouts with Continuations (Aura)](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/apex_continuations.htm)
- [Continuation Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Continuation.htm)
- [Asynchronous Callout Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_limits.htm)
- [Continuation Limits (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations-limits.html)
- [Continuation Example (LWC)](https://developer.salesforce.com/docs/platform/lwc/guide/apex-continuations-component-example.html)
- [@AuraEnabled Annotations for Continuations](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/apex_continuations_auraenabled.htm)
- [Chaining Asynchronous Callouts](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_chained_callouts.htm)
- [Make Long-Running Callouts with Continuations (Apex)](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_overview.htm)
- [Using the transient Keyword](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_transient.htm)

## About the full unit

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