Long-Running Callouts with Multiple Apex Continuations
Salesforce provides the Continuation class in Apex to handle long-running requests to external web services without hitting the limits imposed on synchronous requests. Traditionally, Salesforce only supported Continuations from Visualforce pages , but since the Summer '19 release , both Aura and Lightning Web Components (LWC) can also invoke Apex Continuation methods. This functionality allows handling multiple asynchronous callouts, which no longer count against the 10 synchronous callout limit that exceeds five seconds. What is a Continuation? A Continuation is a pattern where an Apex method makes a request to an external service but does not wait for the response immediately. The request "forgets" about the response and allows Salesforce to process it asynchronously. Once the response is received, a callback method is invoked to handle the data. Example: Making Multiple Callouts with Apex Continuation Below is an example that demonstrates how to send multiple long-...