Salesforce App Limits Cheatsheet
DOWNLOAD
First things first !
To download this implementation guide, click the download button below.
If you need more information about the implementation guide, you can read the Table of Contents below.
SALESFORCE DEVELOPER LIMITS AND
ALLOCATIONS QUICK REFERENCE
Summary
Find the most critical limits
for developing Lightning
Platform applications
About This Quick Reference
This quick reference provides common limits and allocations for Salesforce and doesnt cover all limits
and allocations It might contain limits or allocations that dont apply to your Salesforce org Stated limits
arent a promise that the specified resource is available at its limit in all circumstances Load performance
and other system issues can prevent some limits from being reached
This guide doesnt include limits or allocations for
User interface elements in the Salesforce application
Field lengths of Salesforce objects
Desktop integration clients
Your Salesforce contract
Information for specific feature limits such as the number of total and active rules in your org are also in
Salesforce Help see the topics for using that feature For allocations per edition see Salesforce Features
and Edition Allocations For information on limits when using Salesforce Functions see Functions Limits
Contractual limits might also apply as per your Salesforce contract
Apex Governor Limits
Read up on Apex limits details in Execution Governors and Limits
Because Apex runs in a multitenant environment the Apex runtime engine strictly enforces limits so that
runaway Apex code or processes dont monopolize shared resources If some Apex code exceeds a limit
the associated governor issues a runtime exception that cant be handled
PerTransaction Apex Limits
These limits count for each Apex transaction For Batch Apex these limits are reset for each execution of
a batch of records in the execute method
This table lists limits for synchronous Apex and asynchronous Apex Batch Apex and future methods
when theyre different Otherwise this table lists only one limit that applies to both synchronous and
asynchronous Apex
Note
Although scheduled Apex is an asynchronous feature synchronous limits apply to scheduled
Apex jobs
For Bulk API and Bulk API transactions the effective limit is the higher of the synchronous
and asynchronous limits For example the maximum number of Bulk Apex jobs added to the
queue with SystemenqueueJob is the synchronous limit which is higher than the
asynchronous limit
Last updated December
Salesforce Developer Limits and Allocations Quick Reference
Apex Governor Limits
Description
Synchronous Asynchronous
Limit
Limit
Total number of SOQL queries issued
Total number of records retrieved by SOQL queries
Total number of records retrieved by
Total number of records processed as a result of DML statements
Approvalprocess or databaseemptyRecycleBin
Total stack depth for any Apex invocation that recursively fires triggers
due to insert update or delete statements
Total number of callouts HTTP requests or web services calls in a
transaction
Maximum cumulative timeout for all callouts HTTP requests or Web
services calls in a transaction
seconds
seconds
Maximum number of methods with the future annotation allowed
per Apex invocation
in batch and
future
contexts in
queueable
context
Maximum number of Apex jobs added to the queue with
MB
MB
Maximum CPU time on the Salesforce servers
milliseconds
milliseconds
Maximum execution time for each Apex transaction
minutes
minutes
Maximum number of push notification method calls allowed per Apex
transaction
Maximum number of push notifications that can be sent in each push
notification method call
Maximum number of EventBuspublish calls for platform events
configured to publish immediately
DatabasegetQueryLocator
Total number of SOSL queries issued
Total number of records retrieved by a single SOSL query
Total number of DML statements issued
SystemenqueueJob
Total number of sendEmail methods allowed
Total heap size
Salesforce Developer Limits and Allocations Quick Reference
Apex Governor Limits
In a SOQL query with parentchild relationship subqueries each parentchild relationship counts as an
extra query These types of queries have a limit of three times the number for toplevel queries The limit
for subqueries corresponds to the value that LimitsgetLimitAggregateQueries returns
The row counts from these relationship queries contribute to the row counts of the overall code execution
This limit doesnt 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
DatabasecountQuery DatabasecountQueryWithBinds
DatabasegetQueryLocator DatabasegetQueryLocatorWithBinds
Databasequery DatabasequeryWithBinds
Calls to the following methods count against the number of DML statements issued in a request
Approvalprocess
DatabaseconvertLead
DatabaseemptyRecycleBin
Databaserollback
DatabasesetSavePoint
delete and Databasedelete
insert and Databaseinsert
merge and Databasemerge
undelete and Databaseundelete
update and Databaseupdate
upsert and Databaseupsert
EventBuspublish for platform events configured to publish after commit
SystemrunAs
Recursive Apex that doesnt 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
Email services heap size is MB
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 dont consume application server CPU time arent counted toward
CPU time For example the portion of execution time spent in the database for DML SOQL and SOSL isnt
counted nor is waiting time for Apex callouts Application server CPU time spent in DML operations is
counted towards the Apex CPU limit but isnt expected to be significant Bulk API and Bulk API consume
a unique governor limit for CPU time on Salesforce Servers with a maximum value of milliseconds
Note
Limits apply individually to each testMethod
To determine the code execution limits for your code while its 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
Salesforce Developer Limits and Allocations Quick Reference
Apex Governor Limits
getLimitDMLStatements method to determine the total number of DML statements
available to your code
PerTransaction Certified Managed Package Limits
Certified managed packagesmanaged packages that have passed the security review for
AppExchangeget their own set of limits for most pertransaction limits Salesforce ISV Partners develop
certified managed packages which are installed in your org from AppExchange and have unique
namespaces
Heres an example that illustrates the separate certified managed package limits for DML statements If
you install a certified managed package all the Apex code in that package gets its own DML statements
These DML statements are in addition to the DML statements your orgs native code can execute
This limit increase means more than DML statements can execute during a single transaction if code
from the managed package and your native org both executes Similarly the certified managed package
gets its own SOQLquery limit for synchronous Apex in addition to the orgs native code limit of
SOQL queries
Theres no limit on the number of certified namespaces that can be invoked in a single transaction
However the number of operations that can be performed in each namespace must not exceed the
pertransaction limits Theres also a limit on the cumulative number of operations that can be made across
namespaces in a transaction This cumulative limit is times the pernamespace limit For example if
the pernamespace limit for SOQL queries is a single transaction can perform up to SOQL
queries In this case the cumulative limit is times the pernamespace limit of These queries can
be performed across an unlimited number of namespaces as long as any one namespace doesnt have
more than queries The cumulative limit doesnt affect limits that are shared across all namespaces
such as the limit on maximum CPU time
Note
These crossnamespace limits apply only to namespaces in certified managed packages
Namespaces in noncertified packages dont have their own separate governor limits The
resources that they use continue to count against the same governor limits used by the orgs
custom code
This table lists the cumulative crossnamespace limits
Description
Cumulative
CrossNamespace
Limit
Total number of SOQL queries issued
Total number of records retrieved by DatabasegetQueryLocator
Total number of SOSL queries issued
Total number of DML statements issued
Total number of callouts HTTP requests or web services calls in a transaction
Total number of sendEmail methods allowed
Salesforce Developer Limits and Allocations Quick Reference
Apex Governor Limits
All pertransaction limits count separately for certified managed packages except for
The total heap size
The maximum CPU time
The maximum transaction execution time
The maximum number of unique namespaces
These limits count for the entire transaction regardless of how many certified managed packages are
running in the same transaction
The code from a package from AppExchange not created by a Salesforce ISV Partner and not certified
doesnt have its own separate governor limits Any resources used by the package count against the total
org governor limits Cumulative resource messages and warning emails are also generated based on
managed package namespaces
For more information on Salesforce ISV Partner packages see Salesforce Partner Programs
Lightning Platform Apex Limits
The limits in this table arent specific to an Apex transaction Lightning Platform enforces these limits
Description
Limit
The maximum number of asynchronous Apex method executions batch
or the number
Apex future methods Queueable Apex and scheduled Apex per a hour of user licenses in your
period
org multiplied by
whichever is greater
Number of synchronous concurrent transactions for longrunning transactions
that last longer than seconds for each org
Maximum number of Apex classes scheduled concurrently
In Developer Edition
orgs the limit is
Maximum number of batch Apex jobs in the Apex flex queue that are in
Holding status
Maximum number of batch Apex jobs queued or active concurrently
Maximum number of batch Apex job start method concurrent executions
Maximum number of batch jobs that can be submitted in a running test
Maximum number of test classes that can be queued per hour period
production orgs other than Developer Edition
The greater of or
multiplied by the
number of test classes in
the org
Maximum number of test classes that can be queued per hour period
sandbox and Developer Edition orgs
The greater of or
multiplied by the
number of test classes in
the org
Salesforce Developer Limits and Allocations Quick Reference
Apex Governor Limits
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 The license types that count toward this limit include full
Salesforce and Salesforce Platform user licenses App Subscription user licenses Chatter Only users Identity
users and Company Communities users
If more transactions are started while the longrunning transactions are still running theyre denied
HTTP callout processing time isnt included when calculating this limit
When batch jobs are submitted theyre held in the flex queue before the system queues them for
processing
Batch jobs that havent started yet remain in the queue until theyre started If more than one job is
running this limit doesnt cause any batch job to failexecute methods of batch Apex jobs still run in
parallel
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
To check how many asynchronous Apex executions are available make a request to REST API limits
resource or use Apex methods OrgLimitsgetAll or OrgLimitsgetMap See List
Organization Limits in the REST API Developer Guide and OrgLimits Class in the Apex Reference Guide
Static Apex Limits
Description
Limit
Default timeout of callouts HTTP requests or Web services calls in a
transaction
seconds
Maximum size of callout request or response HTTP request or Web services MB for synchronous
call
Apex or MB for
asynchronous Apex
Maximum SOQL query run time before Salesforce cancels the transaction
seconds
Maximum number of class and trigger code units in a deployment of Apex
Apex trigger batch size
For loop list batch size
Maximum number of records returned for a Batch Apex query in
million
DatabaseQueryLocator
The HTTP request and response sizes count towards the total heap size
The Apex trigger batch size for platform events and Change Data Capture events is
Salesforce Developer Limits and Allocations Quick Reference
API Request Limits and Allocations
SizeSpecific Apex Limits
Description
Limit
Maximum number of characters for a class
million
Maximum number of characters for a trigger
million
Maximum amount of code used by all Apex code in an org
MB
Method size limit
bytecode
instructions in compiled
form
This limit doesnt apply to Apex code in first generationGP or second generationGP managed
packages The code in those types of packages belongs to a namespace unique from the code in your
org This limit also doesnt apply to any code included in a class defined with the isTest annotation
Large methods that exceed the allowed limit cause an exception to be thrown during the execution of
your code
Push Notification Limits
An org can send up to iOS and Android push notifications per hour for example to
UTC
Only deliverable notifications count toward this limit For example a notification is sent to employees
in your company but employees havent installed the mobile app yet Only the notifications sent to
the 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 orgs hourly push notification limit
When an orgs hourly push notification limit is met any additional notifications are still created for inapp
display and retrieval via REST API
API Request Limits and Allocations
These limits and allocations apply to Salesforce Platform SOAP and REST APIs and any other API built on
those frameworks unless noted otherwise For information about limits on other Salesforce APIs such as
Connect REST API visit that specific documentation
To maintain optimum performance and ensure that the Lightning Platform API is available to all our
customers Salesforce balances transaction loads by imposing three types of limits
Concurrent API Request Limits
API Timeout Limits
Total API Request Allocations
When a call exceeds a request limit an error is returned
Salesforce Developer Limits and Allocations Quick Reference
API Request Limits and Allocations
Concurrent API Request Limits
The following table lists the limits for various types of orgs for concurrent inbound requests calls with a
duration of seconds or longer
Org Type
Limit
Developer Edition and Trial orgs
Production orgs and Sandboxes
If the number of long running requests exceeds the limit the API returns a
REQUESTLIMITEXCEEDED exception code Any new concurrent requests arent processed until
there are fewer requests than the allowed limit For example in a production org no new concurrent
requests are allowed until there are fewer than long running requests
There isnt a limit on the number of concurrent requests shorter than seconds
API Timeout Limits
The timeout limit for REST and SOAP API calls is minutes except for any query call The timeout for
query calls is set by the SOQL limits For details on SOQL limits visit SOQL and SOSL Limits for Search Queries
For timeout limits on calls made using other Salesforce APIs such as the Connect REST API and Bulk APIs
visit the specific documentation for those APIs
If a request exceeds this limit the API returns a REQUESTRUNNINGTOOLONG status code for
SOAP API or a QUERYTIMEOUT exception code for REST API
For calls to Composite Resources in REST API this timeout applies to the entire composite request not to
each subrequest
Total API Request Allocations
The following table lists the limits for the total inbound API requests calls per hour period for an org
Salesforce Edition
API Calls Per License Type
Per Hour Period
Total Calls Per Hour
Period
Developer Edition
NA
Enterprise Edition
Salesforce
Professional Edition with
API access enabled
Salesforce Platform
number of licenses x
calls per license type purchased
API Call AddOns
Lightning Platform One App
Customer Community
Customer Community Login
Customer Community Plus
Salesforce Developer Limits and Allocations Quick Reference
Salesforce Edition
API Request Limits and Allocations
API Calls Per License Type
Per Hour Period
Total Calls Per Hour
Period
Customer Community Plus
Login
External Identity SKU
External Identity SKU
External Identity
SKU
Partner Community
Partner Community Login
Lightning Platform Starter
per member for Enterprise
Edition orgs
Lightning Platform Plus
per member for Enterprise
Edition orgs
Unlimited Edition
Salesforce
Performance Edition
Salesforce Platform
Lightning Platform One App
Customer Community
Customer Community Login
Customer Community Plus
Customer Community Plus
Login
External Identity SKU
External Identity SKU
External Identity
SKU
Partner Community
Partner Community Login
Lightning Platform Starter
per member for Unlimited and
Performance Edition orgs
number of licenses x
calls per license type purchased
API Call AddOns
Salesforce Developer Limits and Allocations Quick Reference
Salesforce Edition
API Request Limits and Allocations
API Calls Per License Type
Per Hour Period
Total Calls Per Hour
Period
Lightning Platform Plus
per member for Unlimited and
Performance Edition orgs
Full Sandbox
NA
This limit applies only to Full
Sandboxes that arent created from
a template For any sandbox
created from a template values in
the template determine the limits
For more information visit
Salesforce Help Sandbox Types and
Templates
For Experience Cloud limits see Experience Cloud User Licenses
Note Load performance and other system issues can prevent you from using your entire allocation
of calls in a hour period
APIs that count toward this allocation include the Lightning Platform REST API the Lightning Platform
SOAP API Bulk API and Bulk API API calls issued by certain Salesforce connected apps for example
the Salesforce mobile app dont count To determine which APIs affect the allocation see Monitoring
Your API Usage
Calls that include DebuggingHeader have a separate allocation limit of calls per hour period
These calls can continue to be made after the total request limit for an org is reached
Limits and allocations are enforced against the aggregate of all API calls made to the org in a hour
period Limits and allocations are not on a peruser basis
Monitoring Your API Usage
To better monitor your orgs API usage and limits you can use these resources
The API Usage section of the System Overview page in Setup
The API Requests Last Hours item in the Organization Detail section of the Company Information
page in Setup
The API Request Limit per Month usagebased entitlement which shows you your orgs API calls
aggregated over days This information can be found on the Company Information page in Setup
Information returned in the SforceLimitInfo response header for REST APIs
Information returned in the response body in typeAPI REQUESTStype for SOAP APIs
The limits call in the Lightning Platform REST API
You can configure your org so that email is sent to a designated user when the number of API requests
has exceeded a specified percentage of the amount allotted Perform this configuration from Setup by
entering API Usage Notifications in the Quick Find box and then selecting API Usage
Notifications
Salesforce Developer Limits and Allocations Quick Reference
API Request Limits and Allocations
See also the Learn About Daily Rate Limits section in the App Development Without Limits Trailhead
module
What Happens If You Reach or Exceed Your API Request
Limit
If your org reaches or exceeds its daily API request limit Salesforce still lets the operations proceed by a
certain amount if possible It helps avoid blocking your workflows during unexpected spikes in 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 Dont
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 doesnt apply to trial orgs Developer Edition
or sandboxes
API request activity is aggregated into day periods starting with your contract start date and includes
calls that exceed the orgs entitled limit
Increasing Total API Request Allocations
The total number of API requests allowed is defined by the users licenses in the org If you need more API
requests in your org use Your Account App to buy additional user licenses or extra API calls For more
information visit Salesforce Help Add Products and Licenses with the Your Account App or contact your
account executive
Before you buy more API calls review your current API usage and reduce your total number of requests
if possible For example you can optimize either your own or a partner client application to use fewer API
calls and still accomplish the same work If you use a partner app consult with the vendor to verify that
the product makes optimal use of the API A product that makes inefficient use of the API incurs unnecessary
costs for your company You can also use REST API Composite Resources to improve your applications
performance by minimizing the number of roundtrips between the client and server
Example API Usage Metering Calculations
These examples illustrate API usage metering calculations for several scenarios
For an Enterprise Edition org with Salesforce licenses the request limit is requests
plus licenses x calls
For a Developer Edition org that made calls at AM Wednesday calls at PM
Wednesday only one more call can successfully be made until AM Thursday
Salesforce Developer Limits and Allocations Quick Reference
Connect REST API Limits
Request Size Limits
In each REST call the maximum length for the combined URI and headers is bytes A request
exceeding this limit returns a Request Header Fields Too Large error If the URI itself exceeds this limit
the request returns a URI Too Long error
Note Other factors such as browsers and load balancers can lower the maximum length of the
URI and headers For publicfacing services its recommended to limit URI length to characters
and headers to approximately bytes
Length of Stored ThirdParty Refresh and Access Tokens
Salesforce stores thirdparty access and refresh tokens of up to characters in length
Connect REST API Limits
Limits protect shared resources These are the limits for consumers of Connect REST API
Connect REST API requests are subject to rate limiting Connect REST API has a different rate limit than
other Salesforce APIs Connect REST API has a per user per application per hour rate limit When you
exceed the rate limit all Connect REST API resources return a Service Unavailable error code
For applications using a session ID from Salesforce the rate limit is per user per hourthere isnt 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 error code
Bulk API and Bulk API Limits and Allocations
Any data operation that includes more than records is a good candidate for Bulk API to successfully
prepare execute and manage an asynchronous workflow that makes use of the Bulk framework Jobs
with fewer than records should involve bulkified synchronous calls in REST for example Composite
or SOAP
Batch Allocations
You can submit up to batches per rolling hour period This allocation is shared between Bulk
API and Bulk API so every batch that is processed in Bulk API or Bulk API counts towards this
allocation
In Bulk API only ingest jobs consume batches Query jobs dont For details see How Requests Are
Processed in the Bulk API Developer Guide
In Bulk API batches are created for you automatically In Bulk API you must create the batches yourself
Salesforce Developer Limits and Allocations Quick Reference
Bulk API and Bulk API Limits and Allocations
General Limits
Item
Bulk API Limit
Bulk API Limit
Batch and job
lifespan
Batches and jobs that are older than seven
days are removed from the queue if batches
are in a terminal state completed aborted or
failed regardless of their respective 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 cant
create batches associated with a job that is
more than hours old Batches in a
nonterminal state that are older than seven
days are periodically cleaned up with their
respective jobs
Jobs in a terminal state
completed aborted or failed
that are older than seven days are
deleted Jobs in a nonterminal
state that are older than seven
days are periodically cleaned up
Binary content
The length of any file name cant exceed NA
bytes
A zip file cant exceed MB
The total size of the unzipped content
cant exceed MB
A maximum of files can be
contained in a zip file Directories dont
count toward this total
Maximum time that hours
a job can remain
open
The same But this only applies
to ingest jobs not query jobs
Limits Specific to Ingest Jobs
Item
Bulk API Limit
Bulk API Limit
Maximum number batches x records
of records uploaded per batch maximum
per hour rolling
period
Batch processing
time
Batches are processed in chunks The chunk Same as Bulk API
size depends on the API version In API version
and earlier the chunk size is records
In API version and later the chunk size is
records If it takes longer than 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 minute limit on subsequent
Salesforce Developer Limits and Allocations Quick Reference
Item
Bulk API and Bulk API Limits and Allocations
Bulk API Limit
Bulk API Limit
attempts the batch is placed back in the
queue and reprocessed up to times before
the batch is permanently marked as failed
Maximum time
before a batch is
retried
minutes
The API automatically handles
retries If you receive a message
that the API retried more than
times use a smaller upload file
and try again
Maximum file size
MB per batch
MB per job
Maximum number
of characters in a
field
Same as Bulk API
Maximum number
of fields in a record
Same as Bulk API
Maximum number
of characters in a
record
Same as Bulk API
Maximum number
of records in a batch
NA
Maximum number
of characters for all
the data in a batch
NA
Limits Specific to Query Jobs
Item
Bulk API Limit
Bulk API Limit
Number of attempts to query
attempts at minutes each to
process the batch Theres also a
minute limit on the time to
process the query If more than
attempts are made for the
query an error message of Tried
more than thirty times is
returned If the query takes more
than minutes to process a
QUERYTIMEOUT error is
returned
The API automatically handles
retries If you receive a message
that the API retried more than
times apply a filter criteria and try
again
Batch size
Without PK chunking enabled The API automatically handles
only one batch is created If you batch management
create a batch with PK chunking
enabled batches are broken up
Salesforce Developer Limits and Allocations Quick Reference
Item
API Query Cursor Limits
Bulk API Limit
Bulk API Limit
based on the number of records
in the chunk This can range from
to records
Number of retrieved files
files If the query returns more NA
than files add filters to the
query to return less data Bulk
batch sizes arent used for bulk
queries
Timeout for retrieving query
results
minutes
Same as Bulk API
Results lifespan
You can retrieve the query jobs
results within days of job
completion
Same as Bulk API
Maximum retrieved file size
GB If processing of the batch
results in GB of retrieved data
then those results are saved to
disk and then the batch is put
back on the queue to be resumed
later This also counts as one of
the retries
Same as Bulk API
Number of query jobs that can be See Batch Allocations
submitted per hour rolling
window
Additionally the API client can
navigate through the full set of
results by using the locator
and maxRecords query
parameters The client isnt bound
to a set of files
The current number can be seen
in the
DailyBulkVQueryJobs
value in the response to the
vXXXlimits REST API
method
Total query results that can be
generated per hour rolling
window
NA
TB
The current size can be seen in
the
DailyBulkVQueryFileStorageMB
value in the response to the
vXXXlimits REST API
method
API Query Cursor Limits
Cursors and their related query results are available for days including results in nested queries There
isnt a limit on the number of open cursors