Salesforce uses multitenancy technology to share IT resources securely among multiple applications and tenants (businesses, organizations, etc.) because resources are being shared by multiple tenants, Salesforce strictly enforces governor limits to ensure that any one tenant does not monopolize these shared resources in the multitenent environment. If a governor limit is exceeded, the associated governor issues a runtime exception that cannot be handled. Some of the important Governor Limits in Salesforce are:
Certified managed packages—managed packages that have passed the security review for AppExchange—get their own set of limits for most per-transaction limits.
Description
Cumulative Cross-Namespace Limit
Total number of SOQL queries issued
1,100
Total number of records retrieved by Database.getQueryLocator
110,000
Total number of SOSL queries issued
220
Total number of DML statements issued
1,650
Total number of callouts (HTTP requests or web services calls) in a transaction
1,100
Total number of sendEmail methods allowed
110
3. Lightning Platform Apex Governor Limits
Description
Limit
The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period
250,000 or the number of user licenses in your org multiplied by 200, whichever is greater
Number of synchronous concurrent transactions for long-running transactions that last longer than 5 seconds for each org.
10
Maximum number of Apex classes scheduled concurrently
100. In Developer Edition orgs, the limit is 5.
Maximum number of batch Apex jobs in the Apex flex queue that are in Holding status
100
Maximum number of batch Apex jobs queued or active concurrently
5
Maximum number of batch Apex job start method concurrent executions
1
Maximum number of batch jobs that can be submitted in a running test
5
Maximum number of test classes that can be queued per 24-hour period (production orgs other than Developer Edition)
The greater of 500 or 10 multiplied by the number of test classes in the org
Maximum number of test classes that can be queued per 24-hour period (sandbox and Developer Edition orgs)
The greater of 500 or 20 multiplied by the number of test classes in the org
Maximum number of query cursors open concurrently per user
50
Maximum number of query cursors open concurrently per user for the Batch Apex start method
15
Maximum number of query cursors open concurrently per user for the Batch Apex execute and finish methods
5
4. Static Apex Governor Limits
Description
Limit
Default timeout of callouts (HTTP requests or Web services calls) in a transaction
10 seconds
Maximum size of callout request or response (HTTP request or Web services call)
6 MB for synchronous Apex or 12 MB for asynchronous Apex
Maximum SOQL query run time before Salesforce cancels the transaction
120 seconds
Maximum number of class and trigger code units in a deployment of Apex
7500
Apex trigger batch size
200
For loop list batch size
200
Maximum number of records returned for a Batch Apex query in Database.QueryLocator
50 million
5. Size-Specific Apex Governor Limits
Description
Limit
Maximum number of characters for a class
1 million
Maximum number of characters for a trigger
1 million
Maximum amount of code used by all Apex code in an org
3 MB
Method size limit(Large methods that exceed the allowed limit cause an exception to be thrown during the execution of your code.)
65,535 bytecode instructions in compiled form
6. Metadata Governor Limits
The following limits apply to the Salesforce Extensions for Visual Studio Code, the Ant Migration Tool, and the Metadata API.
Limit
Description
Retrieving and deploying metadata
You can deploy or retrieve up to 10,000 files at once. AppExchange packages use different limits: They can contain up to 35,000 files. The maximum size of the deployed or retrieved .zip file is 39 MB. If the files are uncompressed in an unzipped folder, the size limit is 400 MB.
Change sets
Inbound and outbound change sets can have up to 10,000 files of metadata.
7. SOQL and SOSL Governor Limits for Search Queries
Feature
Limit
Limit Description
SOQL statements
Maximum length of SOQL statements
By default, 100,000 characters.
SOQL WHERE clause
Strings in SOQL WHERE clauses
4,000 characters for each string within a WHERE clause.
SOQL query results
Maximum rows returned
2,000 results total (API version 28.0 and later), unless you specify custom limits in the query. This limit includes results from child objects. Previous API versions return 200 results.
SOSL statements
Maximum length of SOSL statements
By default, 100,000 characters. This limit is tied to the SOQL statement character limit defined for your org.
SOSL search query strings
Maximum length of SearchQuery string
If the SearchQuery string is longer than 10,000 characters, no result rows are returned. If SearchQuery is longer than 4,000 characters, any logical operators are removed. For example, the AND operator in a statement with a SearchQuery that’s 4,001 characters will default to the OR operator, which could return more results than expected.
SOSL query results
Maximum rows returned
2,000 results total (API version 28.0 and later), unless you specify custom limits in the query. This limit includes results from child objects. Previous API versions return 200 results.
Relationship queries
Relationship query limits
No more than 55 child-to-parent relationships can be specified in a query. A custom object allows up to 40 relationships, so you can reference all the child-to-parent relationships for a custom object in one query.No more than 20 parent-to-child relationships can be specified in a query.In each specified relationship, no more than five levels can be specified in a child-to-parent relationship. For example, Contact.Account.Owner.FirstName (three levels).In each specified relationship, only one level of parent-to-child relationship can be specified in a query. For example, if the FROM clause specifies Account, the SELECT clause can specify only the Contact or other objects at that level. It could not specify a child object of Contact.
FOR VIEW and FOR REFERENCE
Maximum RecentlyViewed records allowed
The RecentlyViewed object is updated every time the logged-in user views or references a record. It is also updated when records are retrieved using the FOR VIEW or FOR REFERENCE clause in a SOQL query. To ensure that the most recent data is available, RecentlyViewed data is periodically truncated down to 200 records per object. RecentlyViewed data is retained for 90 days, after which it is removed on a periodic basis.
OFFSET clause
Maximum number of rows skipped by OFFSET
The maximum offset is 2,000 rows. Requesting an offset greater than 2,000 results in a NUMBER_OUTSIDE_VALID_RANGE error.
8. General Flow Governor Limits
Per-Org Limit
Essentials or Professional editions
Enterprise, Unlimited, Performance, or Developer editions
Versions per flow
50
50
Executed elements at runtime per flow
2,000
2,000
Active flows per flow type
5
2,000
Total flows per flow type
5
4,000
Flow interviews that are resumed per hour or groups of scheduled actions from processes that are executed per hour based on a specific time
1,000
1,000
Combined total of these automations that start or resume based on a record’s field value. Resume events that are defined in active flows Groups of scheduled actions that are defined in active processes Time triggers that are defined in active workflow rules Inactive flow interviews that are resumed
20,000
20,000
Schedule-triggered flow interviews per 24 hours
250,000, or the number of user licenses in your org multiplied by 200, whichever is greater
250,000, or the number of user licenses in your org multiplied by 200, whichever is greater
9. Per-Transaction Flow Limits
Per-Transaction Limit
Value
Total number of SOQL queries issued(All executions of Get Records elements, and executions of Update Records or Delete Records elements that use filter conditions)
100
Total number of records retrieved by SOQL queries(All executions of Get Records elements, and executions of Update Records or Delete Records elements that use filter conditions)
50,000
Total number of DML statements issued(Create Records, Update Records, and Delete Records executions)
150
Total number of records processed as a result of DML statements
10,000
Maximum CPU time on the Salesforce servers
10,000 milliseconds
Total number of duplicate updates allowed in one batch
12
10. Push Notification Limits
Push Notification Governor Limits in Salesforce:
An org can send up to 20,000 iOS and 10,000 Android push notifications per hour (for example, 4:00 to 4:59 UTC).
Only deliverable notifications count toward this limit.
Each test push notification that is generated through the Test Push Notification page is limited to a single recipient. Test push notifications count toward an org’s hourly push notification limit.
When an org’s hourly push notification limit is met, any additional notifications are still created for in-app display and retrieval via REST API.