Where: This change applies to Lightning Experience and Salesforce Classic in Essentials, Professional, Enterprise, Performance, Unlimited, and Developer editions.
Why: Programmers can design their code so that similar actions are performed together in one batch. For example, you can create 50 records with one operation rather than 50 separate operations. We call this concept bulkification. Even with no-code flows and processes, bulkification can prevent you from reaching governor limits because the batch is counted as only one operation. An operation is bulkifiable if it sends emails or creates, updates, deletes, or looks up records.
When multiple interviews for the same flow or process run in one transaction, each interview runs until it reaches a bulkifiable operation. Salesforce defers that operation until all interviews in the transaction reach that same operation. Then Salesforce executes that operation for all the interviews together.
In flows, queries are generated when executing:
- Record Update elements
- Record Delete elements
- Record Lookup elements
- Fast Lookup elements
- Subflow elements whose referenced flows create queries
- Apex elements whose referenced Apex code creates queries
In processes, queries are generated when executing:
- Update Records actions
- Flows actions whose referenced flows create queries
- Apex actions whose referenced Apex code creates queries
Without this update enabled, Salesforce defers bulkifiable queries but doesn’t execute them in batches. Instead, it executes the queries one by one. The debug logs for your processes and flows include events that start with FLOW_BULK_ELEMENT, which indicate that Salesforce deferred the query to batch it with similar queries. Nevertheless, Salesforce executes each bulkifiable query one by one instead of in a batch.
For example, when you upload 100 cases, the Activity Management flow starts for each case, resulting in 100 interviews.
- 50 interviews stop at Record Lookup element Look Up Events.
- The other 50 interviews stop at Record Lookup element Look Up Tasks.
|Without this update||With this update|
|Every query is executed separately, resulting in 100 query operations.||The queries are executed in two batches, resulting in two query operations.
How: To test this critical update, we recommend working in a sandbox. If you must work in your production org, do so during off-peak hours.
- From Setup, enter Critical in the Quick Find box, then select Critical Updates.
- For Enable Flow and Process Queries to Execute in Batches, click Activate.
- Test all your flows and processes.
If you experience any issues, contact Salesforce Customer Support.