+ Start a Discussion
Love SFDCLove SFDC 

Governor limits question

Governor limit question:
--------Maximum timeout for all callouts (HTTP requests or Web services calls) in a transaction 120 seconds------

Is my understanding correct ? If I've 3 callouts made, sum of all callout times should not exceed 120 seconds.
 
ClintLeeClintLee
That's correct.  In a single transaction the cumulative timeout for all callouts is 120 seconds.

Here's an excerpt from the docs:

"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."

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_timeouts.htm

Hope that helps,

Clint

 
Amit Chaudhary 8Amit Chaudhary 8
Callout Limits and Limitations
The following limits and limitations apply when Apex code makes a callout to an HTTP request or a Web services call. The Web services call can be a SOAP API call or any external Web services call.

1) A single Apex transaction can make a maximum of 100 callouts to an HTTP request or an API call.
2) The default timeout is 10 seconds. A custom timeout can be defined for each callout. The minimum is 1 millisecond and the maximum is 120,000 milliseconds. See the examples in the next section for how to set custom timeouts for Web services or HTTP callouts.
3) 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.
4) 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.
5) Pending operations can occur before mock callouts in the same transaction. See Performing DML Operations and Mock Callouts for WSDL-based callouts or Performing DML Operations and Mock Callouts for HTTP callouts.
6) When the the header Expect: 100-Continue is added to a callout request, a timeout will occur if a HTTP/1.1 100 Continue response isn’t returned by the external server.