Performance18% of the exam

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.

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

~7 min read · 8 practice questions ·

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

Parallel callouts per continuation
Detail
3
Continuation timeout
Detail
Maximum 120 seconds; HttpRequest timeouts ignored
Visualforce controller state
Detail
80 KB, separate from 170 KB view state
HTTP response size
Detail
1 MB maximum
Status code 2000
Detail
Timeout reached before the server responded
Callback transaction
Detail
New transaction; all limits reset
Long-running request limit
Detail
All callouts excluded since Winter '20
LWC import scope
Detail
@salesforce/apexContinuation/Class.method
Client concurrency
Detail
One continuation in progress at a time
DML
Detail
Not in the method returning the Continuation; allowed in the callback
Sources for this section (5)
  • 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?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Platform Developer II pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 28 lessons of the Platform Developer II guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (8 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Platform Developer II exam