Run Flows For List Step
  • 14 Oct 2021
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Run Flows For List Step

  • Dark
    Light

Article summary

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. 

Additional Resources 
For more information on Parallel Batch Processing in Decisions, see:

Run Flow Behaviors 

Additional Resources on Run Behaviors 
The following chart provides information on how each Flow Run Behavior on the Run Flows For List step functions.
For additional information on how each Behavior operates, see Run Flows For List Step - Run Behaviors Detailed.
Setting NameFunction
SynchronousRuns in real-time on the current Flow or Thread. Similar to how In-Session Forms display to the current user immediately.
ThreadJobRuns in a Synchronous fashion, but uses multiple Threads on the machine to execute faster.
WorkQueueRuns Flows across multiple Queues, splitting the load. When this setting is selected, the step will run Asynchronously from the Flow.
ThreadJobAsyncRuns the Flow Async and doesn't wait for any return data.
 AsyncAndWaitRuns 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.2019-01-24_111250-1.png

  1. From a Designer Folder, select CREATE FLOW, then CREATE a new Flow
  2. From the FlowDesigner, navigate to Steps > Integration > Internal Services > AccountService, and attach a GetAll step to the Start step. 
  3. 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. 
  4. 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 Selection
    Selecting 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

  5. 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 Information
    The Expose All Flow Data box allows the ability to see/utilize all Flow Data from the Parent Flow, in the Item WorkFlow

  6. 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

  7.  From the resulting Flow Designer, connect the Start to the End step. 

  8. Navigate to the Properties of the End step; map Input.EmailAddress to Output Data; then Save and Close the Flow.

  9. Save the Parent Flow, then if desired, Close it. 


Debug

  1. From the Flow Designer, select the Debug link from the top Action Bar.
  2. Click FULL. 
  3. Select Run Flows For List [Batch Processing] 1 > Execution 1 > View Output Data
    About Debug Results 
    The resulting Output will display a String List of all the Accounts in the Decisions environment. 


Was this article helpful?