Understand Functions Limits

Salesforce Functions code runs "outside" of your org in an elastic compute environment and has separate limits. This article lists Salesforce Functions limits and identifies other Salesforce limits that apply to functions.

For more information on working within Salesforce Functions limits, see Functions Patterns and Best Practices.

Some limits apply per Salesforce Functions license regardless of invocation type.

DescriptionLimitExplanation
Total requests from your functions to your org per 24-hour period235,000 requestsYour invoked functions can make up to 235,000 requests total (across all functions) to your org per license per 24 hours. Functions request allocations are separate from standard org core API limits: only Salesforce Functions can use these 235,000 requests, but Salesforce Functions can't access standard core API limits. After the 235,000 request limit is reached, requests will start failing. Methods called from your function with a Salesforce Functions SDK are considered requests.
Total function execution time per month1 million GB-secondsYour invoked functions can only run for a total of 1 million GB-seconds per month per license. This limit is distributed across all orgs that are using Salesforce Functions. After this limit is reached, functions will continue to run and you'll be charged for any overages.

Functions can be invoked by Apex either synchronously or asynchronously. Some Salesforce Functions limits change depending on the invocation method.

Asynchronously Invoked Functions

Previously, asynchronously invoked functions didn't enforce a 15-minute timeout. This limit is now enforced and functions running longer than 15 minutes return an error to Apex.

DescriptionLimitExplanation
Function run time15 minutesAsynchronously invoked functions run for 15 minutes before timeout.
Payload size12 MBAn asynchronously invoked function can accept a payload up to 12 MB.
Response size12 MBAn asynchronously invoked function can send a response no larger than 12 MB.
Simultaneous function invocationsno limitThere's no limit on how many times a function can be invoked asynchronously.

Synchronously Invoked Functions

DescriptionLimitExplanation
Function run time2 minutesSynchronously invoked functions run for 2 minutes before timeout.
Payload size6 MBA synchronously invoked function can accept a payload up to 6 MB.
Response size6 MBA synchronously invoked function can send a response no larger than 6 MB.
Simultaneous function invocations10 long-running functionsYou can only invoke 10 long-running (>5 seconds) functions at a time when invoking synchronously.

The following limits aren't specific to Salesforce Functions but relevant to your functions and Apex code.

  • Apex Governor Limits: These limits apply to all Apex code, including code that invokes Salesforce Functions. These limits prevent your code from using resources inefficiently.
  • API Request Limits: These limits include concurrent API requests, API timeout limits, and total API request allocations.
  • Composite Graph API Limits: Functions use the Composite Graph API when making requests using the UnitOfWork class from a Salesforce Functions SDK. Functions that use UnitOfWork are subject to Composite Graph API limits.

See Functions Patterns and Best Practices for guidance on working within limits.