Chunk Size

Last published at: 2023-03-28 19:46:23 UTC

In some actions, such as Run a Flow or Run an Apex Class, you will see a setting for the Chunk Size

Optimize processing by changing chunk size

The Chunk Size sets the number of records processed at a time in a batch job (DAP Job). Different flows might require different chunk sizes for optimal processing. Simple flows can have a large chunk size, while complex flows benefit from a small chunk size.
The chunk size can range from 1 to 25, and is set to 10 by default. You can set a different default chunk size value in an action's main settings, but there are a few options to set the chunk size per flow action as well.

Let users override chunk size

In the Run a Flow and Run an Apex Class settings in the Action Library, you can enable the option for users to change the chunk size when using the action in a DAP Job: Allow users to override the default chunk size.
Note that regardless of this setting, when creating a Macro for Run a Flow or Run an Apex Class, the chunk size can always be changed by the creator of the Macro (but never by the user that executes the Macro).

Set chunk sizes per flow or class

If you'd rather not let your users change the chunk size themselves, but you do want to set a different chunk size for different flows and apex classes, you can create a Macro based on the action. Set a chunk size in each macro that suits the macro's flow or apex class, and assign the macros to the required users or user profiles. Disable access to the Run a Flow or Run an Apex Class action for these users or user profiles, so that they can only use the macros.