Salesforce Decode
Salesforcedecode
Back to questions
IntegrationAdvancedresttimeoutasync

Handle Salesforce REST API 20-second timeout in synchronous integrations

Real World Scenario

A checkout Flow calls REST Composite synchronously to reserve inventory; ERP responses exceed 20 seconds causing UNABLE_TO_LOCK_ROW and abandoned carts during peak hours.

Expected Answer

• Never block user transactions on external latency—move reservation to async Queueable or Platform Event subscriber • Return 202 Accepted pattern with correlation ID for client polling or webhook callback • Set explicit HTTP timeout in middleware below Salesforce callout limit with circuit breaker • Composite subrequests stay under 20s total; split heavy ERP calls to middleware orchestration • Staging object tracks Pending Reserved Failed with user-visible status • Load test at p95 external latency not happy-path 2 seconds • Monitor timeout rate alerting before cart abandonment spikes

Follow-Up Questions & Answers

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

Main difference: use case and scale. Never block user transactions on external latency—move reservation to async Queueable or Platform Event subscriber. Return 202 Accepted pattern with correlation ID for client polling or webhook callback. Pick based on your integration pattern and team capability. Twenty-second REST ceiling is hard platform limit—architects design async handoff before synchronous timeout becomes revenue loss. Optimize for scale and operational observability.

Architect Perspective

Twenty-second REST ceiling is hard platform limit—architects design async handoff before synchronous timeout becomes revenue loss.