Salesforce App Limits Cheatsheet
Salesforce App Limits Cheatsheet
Total stack depth for any Apex invocation that recursively fires triggers 16
due to insert, update, or delete statements3
Maximum cumulative timeout for all callouts (HTTP requests or Web 120 seconds
services calls) in a transaction
Maximum number of methods with the future annotation allowed 50 0 in batch and
per Apex invocation future
contexts; 1 in
queueable
context
Maximum number of push notifications that can be sent in each push 2,000
notification method call
1
In a SOQL query with parent-child relationship subqueries, each parent-child relationship counts as an
extra query. These types of queries have a limit of three times the number for top-level queries. The limit
for subqueries corresponds to the value that Limits.getLimitAggregateQueries() returns.
The row counts from these relationship queries contribute to the row counts of the overall code execution.
This limit doesn’t apply to custom metadata types. In a single Apex transaction, custom metadata records
can have unlimited SOQL queries. In addition to static SOQL statements, calls to the following methods
count against the number of SOQL statements issued in a request.
• Database.countQuery
• Database.getQueryLocator
• Database.query
2
Salesforce Developer Limits and Allocations Quick Reference Apex Governor Limits
2
Calls to the following methods count against the number of DML statements issued in a request.
• Approval.process
• Database.convertLead
• Database.emptyRecycleBin
• Database.rollback
• Database.setSavePoint
• delete and Database.delete
• insert and Database.insert
• merge and Database.merge
• undelete and Database.undelete
• update and Database.update
• upsert and Database.upsert
• EventBus.publish
• System.runAs
3
Recursive Apex that does not fire any triggers with insert, update, or delete statements, exists
in a single invocation, with a single stack. Conversely, recursive Apex that fires a trigger spawns the trigger
in a new Apex invocation. The new invocation is separate from the invocation of the code that caused it
to fire. Spawning a new invocation of Apex is a more expensive operation than a recursive call in a single
invocation. Therefore, there are tighter restrictions on the stack depth of these types of recursive calls.
4
Email services heap size is 36 MB.
5
CPU time is calculated for all executions on the Salesforce application servers occurring in one Apex
transaction. CPU time is calculated for the executing Apex code, and for any processes that are called from
this code, such as package code and workflows. CPU time is private for a transaction and is isolated from
other transactions. Operations that don’t consume application server CPU time aren’t counted toward
CPU time. For example, the portion of execution time spent in the database for DML, SOQL, and SOSL isn’t
counted, nor is waiting time for Apex callouts.
Note:
• Limits apply individually to each testMethod.
• To determine the code execution limits for your code while it is running, use the Limits methods.
For example, you can use the getDMLStatements method to determine the number of
DML statements that have already been called by your program. Or, you can use the
getLimitDMLStatements method to determine the total number of DML statements
available to your code.
3
Salesforce Developer Limits and Allocations Quick Reference Apex Governor Limits
namespaces in a transaction. This cumulative limit is 11 times the per-namespace limit. For example, if
the per-namespace limit for SOQL queries is 100, a single transaction can perform up to 1,100 SOQL
queries. In this case, the cumulative limit is 11 times the per-namespace limit of 100. These queries can
be performed across an unlimited number of namespaces, as long as any one namespace doesn't have
more than 100 queries. The cumulative limit doesn’t affect limits that are shared across all namespaces,
such as the limit on maximum CPU time.
Note: These cross-namespace limits apply only to namespaces in certified managed packages.
Namespaces in packages that are not certified don’t have their own separate governor limits. The
resources they use continue to count against the same governor limits used by your org's custom
code.
This table lists the cumulative cross-namespace limits.
Description Cumulative
Cross-Namespace
Limit
Total number of SOQL queries issued 1,100
Total number of callouts (HTTP requests or web services calls) in a transaction 1,100
Description Limit
The maximum number of asynchronous Apex method executions (batch 250,000 or the number
Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour of user licenses in your
period1 org multiplied by 200,
whichever is greater
Maximum number of batch Apex jobs in the Apex flex queue that are in 100
Holding status
4
Salesforce Developer Limits and Allocations Quick Reference Apex Governor Limits
Description Limit
Maximum number of test classes that can be queued per 24-hour period The greater of 500 or 10
(production orgs other than Developer Edition)5 multiplied by the
number of test classes in
the org
Maximum number of test classes that can be queued per 24-hour period The greater of 500 or 20
(sandbox and Developer Edition orgs)5 multiplied by the
number of test classes in
the org
Maximum number of query cursors open concurrently per user for the Batch 15
Apex start method
Maximum number of query cursors open concurrently per user for the Batch 5
Apex execute and finish methods
1
For Batch Apex, method executions include executions of the start, execute, and finish
methods. This limit is for your entire org and is shared with all asynchronous Apex: Batch Apex, Queueable
Apex, scheduled Apex, and future methods. To check how many asynchronous Apex executions are
available, make a request to REST API limits resource. See List Organization Limits in the REST API
Developer Guide. The licenses that count toward this limit are full Salesforce user licenses or App Subscription
user licenses. Chatter Free, Chatter customer users, Customer Portal User, and partner portal User licenses
aren’t included.
2
If more transactions are started while the 10 long-running transactions are still running, they’re denied.
HTTP callout processing time is not included when calculating this limit.
3
When batch jobs are submitted, they’re held in the flex queue before the system queues them for
processing.
4
Batch jobs that haven’t started yet remain in the queue until they’re started. If more than one job is
running, this limit doesn’t cause any batch job to fail.execute methods of batch Apex jobs still run in
parallel.
5
This limit applies to tests running asynchronously. This group of tests includes tests started through the
Salesforce user interface including the Developer Console or by inserting ApexTestQueueItem
objects using SOAP API.
6
For example, assume that 50 cursors are open. If a client application, logged in as the same user, attempts
to open a new one, the oldest of the 50 cursors is released. Cursor limits for different Lightning Platform
features are tracked separately. For example, you can have all these cursors open concurrently: 50 Apex
query cursors, 15 for the Batch Apex start method, 5 each for the Batch Apex execute and finish
methods, and 5 Visualforce cursors.
5
Salesforce Developer Limits and Allocations Quick Reference Apex Governor Limits
Maximum size of callout request or response (HTTP request or Web services 6 MB for synchronous
call)1 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 5,000
1
The HTTP request and response sizes count towards the total heap size.
2
The Apex trigger batch size for platform events and Change Data Capture events is 2,000.
1
This limit does not apply to Apex code in first generation(1GP) or second generation(2GP) managed
packages. The code in those types of packages belongs to a namespace unique from the code in your
org. This limit also does not apply to any code included in a class defined with the @isTest annotation.
2
Large methods that exceed the allowed limit cause an exception to be thrown during the execution of
your code.
6
Salesforce Developer Limits and Allocations Quick Reference API Request Limits and Allocations
Only deliverable notifications count toward this limit. For example, a notification is sent to 1,000 employees
in your company, but 100 employees haven’t installed the mobile app yet. Only the notifications sent to
the 900 employees who have installed the mobile app 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.
Salesforce Edition API Calls Per License Type Total Calls Per 24-Hour
Per 24-Hour Period Period
Developer Edition N/A 15,000
7
Salesforce Developer Limits and Allocations Quick Reference API Request Limits and Allocations
Salesforce Edition API Calls Per License Type Total Calls Per 24-Hour
Per 24-Hour Period Period
• Customer Community Plus
Login: 10
• External Identity 25,000 SKU:
70,000
• External Identity 250,000 SKU,
750,000
• External Identity 1,000,000
SKU: 4,000,000
• Partner Community: 200
• Partner Community Login: 10
• Lightning Platform Starter: 200
per member for Enterprise
Edition orgs
• Lightning Platform Plus: 1000
per member for Enterprise
Edition orgs
8
Salesforce Developer Limits and Allocations Quick Reference API Request Limits and Allocations
Salesforce Edition API Calls Per License Type Total Calls Per 24-Hour
Per 24-Hour Period Period
• Lightning Platform Plus: 5,000
per member for Unlimited and
Performance Edition orgs
Note:
• At high volume for a single org, other limiting factors such as system load can affect the total
number of calls that are processed in a 24-hour period.
APIs that count toward this allocation include the Lightning Platform REST API, the Lightning Platform
SOAP API, Bulk API, and Bulk API 2.0. API calls issued by certain Salesforce connected apps (for example,
the Salesforce mobile app) don’t count. To determine which APIs affect the allocation, see Monitoring
Your API Usage.
The DebuggingHeader has an extra usage amount of 1,000 calls per 24-hour period.
Limits and allocations are enforced against the aggregate of all API calls made to the org in a 24-hour
period. Limits and allocations are not on a per-user basis.
9
Salesforce Developer Limits and Allocations Quick Reference Connect REST API Limits
workloads and occasional peak periods. A hard cap is in place to safeguard platform resources and prevent
API requests from exceeding the daily limit unimpeded.
Note: The ability to go over your normal daily limit is always subject to restrictions to protect the
overall health of the Salesforce instance that hosts your org. (You can monitor the health of your
instance on Salesforce Trust.)
This ability is designed to be used occasionally to help avoid interruptions in your workflow. Don’t
rely on it on an ongoing basis. To increase your allocation, contact your Salesforce account
representative.
This ability only applies to paid orgs in active status. It does not apply to trial orgs, Developer Edition,
or sandboxes.
API request activity is aggregated into 30 day periods, starting with your contract start date, and includes
calls that exceed the org's entitled limit.
10
Salesforce Developer Limits and Allocations Quick Reference Bulk API Allocations
For applications using a session ID from Salesforce, the rate limit is per user, per hour—there isn't a separate
bucket for applications. All applications the user accesses with a session ID use this general quota. To take
advantage of the per user, per application, per hour limit, use OAuth tokens.
Note: Load, performance, and other system issues can prevent some limits from being reached.
Limits can change without notice. Applications should make efficient use of available requests and
gracefully handle the 503 error code.
Batch lifespan Batches and jobs that are older than seven days are removed from the
queue regardless of job status. The seven days are measured from the
youngest batch associated with a job, or the age of the job if there are
no batches. You can’t create batches associated with a job that is more
than 24 hours old.
Batch size • Batches for data loads can consist of a single CSV, XML, or JSON
file that is no larger than 10 MB.
• A batch can contain a maximum of 10,000 records.
• A batch can contain a maximum of 10,000,000 characters for all
the data in a batch.
• A field can contain a maximum of 32,000 characters.
• A record can contain a maximum of 5,000 fields.
• A record can contain a maximum of 400,000 characters for all its
fields.
• A batch must contain some content or an error occurs.
Batch processing time Batches are processed in chunks. The chunk size depends on the API
version. In API version 20.0 and earlier, the chunk size is 100 records.
In API version 21.0 and later, the chunk size is 200 records. There’s a
5-minute limit for processing each chunk. Also, if it takes longer than
10 minutes to process a whole batch, the Bulk API places the remainder
of the batch back in the queue for later processing. If the Bulk API
continues to exceed the 10-minute limit on subsequent attempts, the
batch is placed back in the queue and reprocessed up to 10 times
before the batch is permanently marked as failed.
Binary content • The length of any file name can’t exceed 512 bytes.
• A zip file can’t exceed 10 MB.
• The total size of the unzipped content can’t exceed 20 MB.
11
Salesforce Developer Limits and Allocations Quick Reference API Query Cursor Limits
Bulk query number of attempts 15 attempts at 10 minutes each to process the batch. There is also a
to query 2-minute limit on the time to process the query. If more than 15
attempts are made for the query, an error message of “Tried more than
fifteen times” is returned. If the query takes more than 2 minutes to
process, a QUERY_TIMEOUT error is returned.
Bulk query number of retrieved 15 files. If the query needs to return more than 15 files, add filters to
files the query to return less data. Bulk batch sizes are not used for bulk
queries.
Job open time The maximum time that a job can remain open is 24 hours. The Bulk
API doesn't support clients that, for example, post one batch every
hour for many hours.
emptyRecycleBin() Maximum number Your org can have up to 5,000 records per license in the
of records in the Recycle Bin at any one time. For example, if your org has
Recycle Bin five user licenses, 25,000 records can be stored in the
Recycle Bin. If your org reaches its Recycle Bin limit,
Salesforce automatically removes the oldest records, as
long as they have been in the recycle bin for at least two
hours.
12
Salesforce Developer Limits and Allocations Quick Reference SOAP API Call Limits
login() Login request size The login request size is limited to 10 KB.
limit
merge() Merge request limits • Up to 200 merge requests can be made in a single
SOAP call.
• Up to three records can be merged in a single request,
including the master record. This limit is the same as
the limit enforced by the Salesforce user interface. To
merge more than 3 records, do a successive merge.
• External ID fields cannot be used with merge().
• If you selected the option to retain the most recently
updated data privacy record for merging leads and
contacts, but the caller does not have CRUD
permission for the selected data privacy record, the
merge process selects the data privacy record already
associated with the master record.
update() Maximum number Your client application can change up to 200 records in a
of records updated single update() call. If an update request exceeds 200
records, the entire operation fails.
query() and Batch size limits WSC clients can set the batch size by calling
queryMore() setQueryOptions() on the connection object. C#
client applications can change this setting by specifying
the batch size in the call QueryOptions portion of the SOAP
header before invoking the query() call. The maximum
batch size is 2,000 records. However this setting is only a
suggestion. There is no guarantee that the requested
batch size will be the actual batch size. This is done to
maximize performance.
The batch size will be no more than 200 if the SOQL
statement selects two or more custom fields of type long
text. This is to prevent large SOAP messages from being
returned.
13
Salesforce Developer Limits and Allocations Quick Reference Metadata Limits
Metadata 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 You can deploy or retrieve up to 10,000 files at once. AppExchange packages
deploying metadata use different limits. In API version 43.0 and 44.0, AppExchange packages can
contain up to 12,500 files. In API version 45.0, AppExchange packages can
contain up to 17,500 files. In API version 46.0, AppExchange packages can
contain up to 22,000 files. In API version 47.0 and later, AppExchange packages
can contain up to 30,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. Note the following:
• If using the Ant Migration Tool to deploy an unzipped folder, all files in
the folder are compressed first. The maximum size of uncompressed
components in an unzipped folder is 400 MB or less depending on the
compression ratio. If the files have a high compression ratio, you can
migrate a total of approximately 400 MB because the compressed size
would be under 39 MB. However, if the components can't be compressed
much, like binary static resources, you can migrate less than 400 MB.
• Metadata API base-64 encodes components after they’re compressed.
The resulting .zip file can't exceed 50 MB, which is the limit for SOAP
messages. Base-64 encoding increases the size of the payload, so your
compressed payload can't exceed approximately 39 MB before encoding.
• You can perform a retrieve() call for a big object only if its index is
defined. If a big object is created in Setup and doesn’t yet have an index
defined, you can’t retrieve it.
Change sets Inbound and outbound change sets can have up to 10,000 files of metadata.
14
Salesforce Developer Limits and Allocations Quick Reference SOQL and SOSL Limits
SOSL statements Maximum length of By default, 100,000 characters. This limit is tied to the
SOSL statements SOQL statement character limit defined for your org.
SOSL search query Maximum length of If the SearchQuery string is longer than 10,000
strings SearchQuery characters, no result rows are returned. If
string 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 2,000 results total (API version 28.0 and later), unless you
returned specify custom limits in the query. Previous API versions
return 200 results.
15
Salesforce Developer Limits and Allocations Quick Reference Visualforce Limits
FOR VIEW and FOR Maximum The RecentlyViewed object is updated every time the
REFERENCE RecentlyViewed records logged-in user views or references a record. It is also
allowed 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 The maximum offset is 2,000 rows. Requesting an offset
rows skipped by greater than 2,000 results in a
OFFSET NUMBER_OUTSIDE_VALID_RANGE error.
Visualforce Limits
Limit Value
Maximum response size for a Visualforce page Less than 15 MB
Maximum size of HTML response before rendering, when Visualforce page Less than 15 MB
is rendered as PDF
Maximum rows retrieved by queries for a single Visualforce page request 50,000
Maximum rows retrieved by queries for a single Visualforce page request 1,000,000
in read-only mode
16
Salesforce Developer Limits and Allocations Quick Reference Visualforce Limits
Limit Value
Maximum collection items that can be iterated in an iteration component 1,000
such as <apex:pageBlockTable> and <apex:repeat>
17