Make Long-Running Callouts with Continuations
Where: This change applies to Aura components and Lightning web components in Lightning Experience, Salesforce Classic, Lightning communities, and all versions of the Salesforce app.
How: Continuations can lead to multiple long-running actions, so be aware of these limits when using them.
- Up to three callouts per continuation
- A single Continuation object can contain a maximum of three callouts.
- Serial processing for continuation actions
- The framework processes actions containing a continuation serially from the client. The previous continuation action call must have completed before the next continuation action call is made. At any time, you can have only one continuation in progress on the client.
- DML operation restrictions
- An Apex method that returns a Continuation object can’t perform Data Manipulation Language (DML) operations. DML statements insert, update, merge, delete, and restore data in Salesforce. If a DML operation is performed within the continuation method, the continuation execution doesn’t proceed, the transaction is rolled back, and an error is returned.
- You can perform DML operations in the Apex callback method for the continuation.