Run Flows For List Step
  • 09 Jun 2022
  • 2 Minutes to read
  • Dark
    Light

Run Flows For List Step

  • Dark
    Light

Article Summary

Overview

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 but it instead 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' behavior to either run Synchronous, Thread Job, Thread Job Async, Work Queue, or Async and Wait.



Flow Run Behaviors

The following table contains information about the selectable Flow Run Behaviors on the Run Flows For List step. These settings will determine if the Flow will run on either a synchronous or asynchronous sub flow. 

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

  1. Begin in a Designer Project and select CREATE FLOW from the top Action bar.
  2. From the Toolbox panel in the Flow Designer, attach a GetAll step from INTEGRATION > INTERNAL SERVICES > ACCOUNTSERVICE category to the Start step. 
  3. Attach a Run Flows For List [Batch Processing] step from Toolbox > SYSTEM > ADVANCED, to both the Get All and the End step. 
  4. 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.
  5. With the Run Flows for List step selected, 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.

  6. 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.
  7. Back in the FLOW section, click the EDIT RUN FLOWS FOR LISTS STEP button. This will create a new Flow tied to the step and open the Flow in the Flow Designer.
  8. In the Flow, connect the Start step to the End step. On the End step choose Select From Flow and map Input.EmailAddress to Output Data.
  9. Save the Flow.



Debug 

  1. From the Flow Designer, select the Debug link from the top Action bar. 
  2. Click the START DEBUGGING button.

    After the Flow runs, click the Run Flows For List step, then select the Execution. Click View Output Data to view the List of Email Addresses.



Was this article helpful?