- 30 Jun 2022
- 2 Minutes to read
Run Flows for List Step
- Updated on 30 Jun 2022
- 2 Minutes to read
Multiple grouped items can be processed using the Run Flows For List step. This step is similar to the For Each step in that it is used to process a list of items received by the step but runs a separate Flow for every item in the list. This gives it the ability to allow for Multi-Threaded processing.
Since an individual Flow is being run for each list item, a user can further configure the Sub Flows' run behavior. This can affect the time it takes to process the list of items.
Flow Run Behaviors
|Flow Behavior Name||Description|
|Synchronous||Runs in real-time on the current Flow or Thread. Similar to how in-session forms display to the current user immediately.|
|ThreadJob||Runs in a synchronous fashion, but uses multiple threads on the machine to execute faster.|
|WorkQueue||Runs Flow across multiple queues, splitting the load.|
|ThreadJobAsync||Runs the Flow Async and doesn't wait for any return data.|
|AsyncAndWait||Runs the processes and pauses the parent Flow until the step has finished executing all of the items in a list.|
|System Threads||Runs the process through Threads that are outside of the Thread Job Queue. The work will be split evenly across all threads|
The following example will run a Flow for each account in a list.
- In a Designer Project, create a Flow.
- From the Toolbox panel in the Flow Designer, attach a GetAll step from the INTEGRATION > INTERNAL SERVICES > ACCOUNTSERVICE category to the Start step.
- Attach a Run Flows For List [Batch Processing] step from SYSTEM > ADVANCED category to the GetAll and End steps.
- Select the Run Flows for List step. On the Properties panel, enter "account" in the Input Type field and select Account. Choose String [Text] from the dropdown list from the Output Type field.
- In the FLOW category, select Synchronous from the Run Behavior dropdown list. Check the Expose All Flow Data checkbox to use all of the Flow Data in the Run Flows For List Flow.
- Under the INPUTS category, click Unknown next to the Input List field and select Select From Flow. Select GetAll1_Output and click DONE. Select Constant for the Remove Null Results field and click the Value checkbox.
- In the FLOW category, click EDIT RUN FLOWS FOR LISTS STEP.
- Connect the Start step to the End step and select the End step. Select the Select From Flow mapping for the Output Data field and select Input.EmailAddress. Click Save and close the Flow.
- Click Save to save changes to the Flow.
- Click Debug from the top Action bar. Click START DEBUGGING.
- After the debugger runs, select the Run Flows For List step, select Execution 1, and select View Input/Output Data.Input Data for the Run Flow For List step indicates that the step accepted a List of Accounts. The Outcome data for this step is a list of Email Addresses from the Input collection Accounts.For further information on Flows, visit the Decisions Forum.