To say "Salesforce does not have limits for callouts" is completely incorrect. From the very document you linked to:
- A single Apex transaction can make a maximum of 100 callouts to an HTTP request or an API call.
This per-transaction governor can be checked at any time in Apex
by calling Limits.getCallouts()
.
- The maximum cumulative timeout for callouts by a single Apex transaction is 120 seconds. This time is additive across all callouts invoked by the Apex transaction.
As far as I know there is no way to track this limit out of the box
- Every org has a limit on long-running requests that run for more than 5 seconds (total execution time). HTTP callout processing time is not included when calculating this limit. We pause the timer for the callout and resume it when the callout completes. See Execution Governors and Limits for Lightning Platform Apex limits.
Maybe this pausing behavior is what leads you to believe there are no limits. But that is not what the documentation conveys here. Rather, it states that time spent waiting for a callout should not contribute to your concurrent long running transactions within the org. Not stated, but also useful to know, is that it does not count against your CPU usage. If you ever do run into the limit described by this bullet you will get a ConcurrentPerOrgLongTxn
error.
- You can’t make a callout when there are pending operations in the same transaction. Things that result in pending operations are DML statements, asynchronous Apex (such as future methods and batch Apex jobs), scheduled Apex, or sending email. You can make callouts before performing these types of operations.
The last bullet here is typically why people use Queueable
implementations to make callouts from triggers. Any time you are within a trigger, there is already some pending work. Hence any synchronous callouts from a trigger will lead to the below error:
You have uncommitted work pending. Please commit or rollback before calling out.
The only way to make callouts from a trigger is asynchronously.