Salesforce Decode
Salesforcedecode
Back to questions
ApexAdvancedcontinuationlwccallouts

Implement Apex Continuation for long external callouts in LWC

Real World Scenario

Credit bureau callout takes 15 seconds exceeding synchronous Apex limit in Lightning.

Expected Answer

• @AuraEnabled(continuation=true) returns Continuation object • Chain callbacks handling response in separate Apex invocation • LWC continuation promise API consumption • Governor limits reset per continuation chunk • Timeout UX with cancel option for user • Test continuation with mock implementations

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. @AuraEnabled(continuation=true) returns Continuation object. Chain callbacks handling response in separate Apex invocation. Pick based on your integration pattern and team capability. Continuation preserves user session context—prefer over fire-and-poll for interactive UX. Optimize for scale and operational observability.

Architect Perspective

Continuation preserves user session context—prefer over fire-and-poll for interactive UX.