Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Salesforce Developer
medium

How would you handle an integration that needs to call an external API for 100 records?

The naive approach — call the API once per record in a loop — fails fast: governor limit of 100 callouts per transaction.

Better patterns:

  1. Batch API on the external side — if the external API supports batch endpoints, send all 100 in one call. Done.
  1. Async chunking via Batch Apex — implement Database.Batchable<sObject>, Database.AllowsCallouts. Each execute() chunk has its own callout limit. Use batch size 100 or less.
  1. Composite API on the Salesforce side — if external systems are calling Salesforce, Composite API bundles multiple subrequests as one HTTP call.
  1. Queueable chain — a Queueable that processes a chunk and chains the next, processing 50 records per chain link. Good when Batch interface doesn't fit.
  1. Platform Events to decouple — publish an event per record; an external subscriber processes asynchronously. Decouples Salesforce from external availability.

Always: mark Database.AllowsCallouts for async; handle errors per-record (log to custom object); don't make blocking callouts in trigger context (use @future(callout=true) or queue to async); respect external rate limits.

Why this answer works

Senior. Naming Database.AllowsCallouts and the Queueable chaining pattern signals senior integration experience.

Follow-ups to expect

Related dictionary terms