- 14 Oct 2021
- 2 Minutes to read
- Print
- DarkLight
Run Flows For List Step
- Updated on 14 Oct 2021
- 2 Minutes to read
- Print
- DarkLight
Overview
Through the use of special Flow Steps within the Flow Designer, users can process multiple grouped together items in a process known as Batch Processing.
One such step that helps users achieve this function, is the Run Flows For List step. This step works similarly to the For Each step in that it is used to process a List of Items received by the step.
The primary difference between the two is that the Run Flows For List is able to run a separate Flow for every item in the list, allowing Multi-Threaded processing. Since an individual Flow is being run for each List Iem, a user can further configure the Child Flows' behavior to either run Synchronous, Thread Job, Thread Job Async, Work Queue, Async and Wait.
The following document demonstrates how to utilize a Run Flows For List step to achieve Multi-Threading in Decisions.
Run Flow Behaviors
For additional information on how each Behavior operates, see Run Flows For List Step - Run Behaviors Detailed.
Setting Name | Function |
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 Flows across multiple Queues, splitting the load. When this setting is selected, the step will run Asynchronously from the Flow. |
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. |
Example
The following example demonstrates how to use the Run Flows For List step to run a Flow for each Account in a List.
- From a Designer Folder, select CREATE FLOW, then CREATE a new Flow.
- From the FlowDesigner, navigate to Steps > Integration > Internal Services > AccountService, and attach a GetAll step to the Start step.
- From Data > List, under the Steps tab, attach a Run Flows For List [Batch Processing] step to the Done path of the Get All step, and to the End step.
- Navigate to the Properties tab of the Run Flows For List step; under Data > Input Type, locate and select Account. Under Output Type, select String, About Type SelectionSelecting these specific Data Types will allow the step to output a String value relating to the iterated Account. In the case of this example, the value will be the associated Email Address.
- Under the Flow category of the Properties tab, select the desired Run Behavior (in this case Synchronous), then ensure that the Expose All Flow Data checkbox is enabled. Additional InformationThe Expose All Flow Data box allows the ability to see/utilize all Flow Data from the Parent Flow, in the Item WorkFlow.
Under Inputs, Select From Flow map GetAll1_Output to Input List. Constant map a True value under Remove Null Results. Then, under Flow > Item Workflow, click Edit.
From the resulting Flow Designer, connect the Start to the End step.
Navigate to the Properties of the End step; map Input.EmailAddress to Output Data; then Save and Close the Flow.
Save the Parent Flow, then if desired, Close it.
Debug
- From the Flow Designer, select the Debug link from the top Action Bar.
- Click FULL.
- Select Run Flows For List [Batch Processing] 1 > Execution 1 > View Output Data. About Debug ResultsThe resulting Output will display a String List of all the Accounts in the Decisions environment.