Complete Guide to Salesforce Flow Limits and How to Avoid Them


You can automate complex business processes and manual data entry with the help of flows.

By saving users time and ensuring that all necessary tasks are executed correctly, flows allow you to work smarter while reducing hard labour. Learn about 'generic' and 'Governer' constraints to take your Salesforce abilities to the next level. These restrictions can appear frightening at first, but understanding the most important concepts and constraints, as well as how you can avoid hitting Salesforce flow limits makes this process more simple.

 

Flows are one of the most powerful tools for Salesforce admins; when set up right, they are like a blessing to your sales team; but, if your flows aren't built appropriately, they may be tough to maintain and it will be a mess for your whole team.

 

Important factors every Salesforce professional must know

 

Why are there limitations on flows?

 

Salesforce works as a multitenant environment, which implies that the resources of the same instance are shared by numerous businesses. Salesforce has imposed certain constraints on each client's use to ensure that no one uses too much space. This is why there are limitations on flows.

 

Interviews and transactions

 

An interview represents a running instance of a flow which is also a complete run of that flow.

A transaction is a collection of operations that are all performed at the same time. Aside from triggers, escalation rules, and other forms of activities, flow interviews are also a part of them.

As a result, a flow interview is constantly active within a transaction.

 

Numerous flow interviews can be run in the same transaction, and a single flow interview can also be run in multiple transactions. The first is possible due to Flow bulkification, while the second is dependent on what constitutes a "single unit." we will them in more detail later. For now, keep in mind that a flow interview is not the same as a transaction, and different limits apply to it.

 

SOQL and DML

 

SOQL and DML are two separate languages that deal with different tasks. SOQL is used to get data, whereas DML is used to edit data. Only the data elements (the pink ones) will utilise these operations in Flow — "Get Records" uses SOQL, and "Create/Update/Delete Records" uses DML with minor variations.

 

Commonly occurring limitations 

 

The limitations you'll most likely hit in the early stages are listed below.

Limits per-flow interview



  • Executed elements at runtime per flow: 200



  • There are a maximum of 2,000 elements that can be executed for each flow interview.
  • If you have a loop, then the components within the loop (including the loop element) will be multiplied by the number of iterations.
  • For example, if 100 records enter a loop with two elements, then the total number of elements is 200.



Limits per transaction:



  • Total no. of SOQL queries issued: 100



Ø  you can only use a maximum of 100 data elements that can retrieve the data.



  • Total no. of DML statements issued: 150



Ø  There are a total of 150 data elements that can be used to change the data.

Ø  (Note that if these components are within the loop, they will be multiplied as well, which is why the best practice which is frequently used is "No Pink in Loop.")



  • Total no. of records pulled by SOQL queries: 50,000

 

Ø  A maximum of 50,000 records can be retrieved.



  • Total no. of records processed due to DML statements: 10,000



Ø  A total of 10,000 records can be modified.



  • Max CPU time on the Salesforce servers: 10,000 milliseconds

 

Ø  The amount of time it takes for the servers to process your solution is referred to as CPU time. The maximum amount of time is 10,000 milliseconds (10 seconds).



  • Total no. of duplicate updates permitted in one batch: 12  



Ø  The same record can only be updated a total of 12 times.

 

 

 

Preventing hitting limitations

 

First of all, ensure that the flow is built in the most efficient manner. Even after following all the best practices, the flow still keeps hitting limits.

What will you do?

The limits are per-flow or interview, hence you can generate multiple flow interviews or transactions.

 

Building coherent flows

 

Planning on how to avoid hitting limits is great! 

 

Hence, follow the below-given steps and you will never have to face the problem of the limitations again.



  • Excessive use of data elements should be avoided.



  • Try to avoid using the data element in a loop.



  • Avoid the loop if possible.



  • Entry criteria should be strict.



  • To update records, use variables and the Assignment element.

 

More flow interviews must be generated

 

When you are dealing with enormous amounts of data, then you are bound to reach the element limit first, followed by the number of records limit.

You can use the bulkification functionality of the Record-Triggered (RT) and Schedule-Triggered (ST) flow to avoid this.

 

Bulkification can be a little complicated, however, keep these things in mind to make it simpler:



  • Build your RT/ST flow as though the triggering item is a single record.
  • Salesforce will batch the records whenever possible.

 

This can help you effectively evade the element limitation. 

 

Generating more transactions

 

You could reach the transaction limit even if you avoid the flow interview limit. You can try to avoid this by generating numerous transactions.

To return to the notion of "single unit," we can think of it as activities that can be completed without pausing.

 

The flow interview will be paused by screening items, planned pathways, and pause actions. The remainder of the flow interview will then be completed in a separate transaction.

 

This is a handy skill to have, but keep in mind that after a transaction is completed, you can't undo the operations because they have already been committed.

 

To wrap it up, Salesforce Flow limitations are imposed to ensure that all clients have an equal opportunity to use the resources. Normally, there are two types of limits (per-flow interview and per transaction), which are two separate and complex theories. But you can build the flows as effectively as possible, use the bulkification tool, or separate the transactions to circumvent these limitations and evenly distribute resources among all the users without disturbing the flows.

 

Founded in 2015, Premium Learning Systems have established a strong foothold in the domain of training with our phenomenal results. Till date, more than 25,000 students have been a part of this journey that has enhanced their skills and enlightened their career paths.

We offer a Career Accelerator Program (C.A.P.) which is an intensive 12-week online training program conducted by Premium Learnings to enable the professionals for the Premium-IT industry even if they are coming from a non-IT background.

For any Queries Contact us: -  https://premiumlearnings.newzenler.com/contact-form/

If you are interested in Salesforce, you can join our Career Accelerator Program (C.A.P).

Click the link and join the course: https://www.premiumlearnings.com/cap/

Have you completed your graduation and are still looking for a job in IT? Or do you want to switch to a career in IT? You can learn about how to do so by reading the details here:

https://www.premiumlearnings.com/blog/reasons-to-switch-to-an-it-job