Run Flow For List Step

Last Updated: 07/26/2016 Introduced in Verision:

This tutorial demonstrates how to use Run Flow For List step. This step was implemented in Decisions 3.5. This step works in the similar manner as For Each loop step, except with this step designer is able to create a Flow to process collection of Items. Moreover, with this step, designer is able to pick Run Behavior: Synchronous, Thread Job or Work Queue. This is a huge advantage for processing large sets of Data.

 

Example:

In this example we are going to use Run Flow For List step to batch process list of Accounts in the Decisions system.

We begin in Designer Folder with clicking Create Flow on the Folder Actions Panel.

createFlow

In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.

nameFlow

In the Flow Designer we add Get All step from Integration > Internal Services > Account Service category.

addGetAllAccs

Next to Get All step we add Run Flow For List step from Data > List category in the Toolbox.

addRunFlowForList

Then, we are going to set up Run Flow For List step. In Data section of step configurations we need to pick Input Type and Output Type. First, using Input Type picker we select Account type.

pickInputType

Next, using Output Type picker we pick String type. We are going to output Email Address from the Account type.

pickTypeForOut

In the Flow section of the step configuration we can build a Flow itself for List processing and pick Run Behavior. For the Run Behavior we have following options: Synchronous, Thread Job, Work Queue. For this example we are going to use Synchronous Run Behavior.

behaviorType

Then, we check Expose All Flow Data checkbox to be able to use all our Flow Data in the Flow For List.

exposeDataToFlow

Next, we Select Value of the Get All Result for Input List Input to this step.

mapInputs

Finally, we click Edit icon for the Item Workflow to build our Flow For List.

editFlow

Flow Designer opens and here we can use any Decisions steps from the Toolbox to process each item from the List input. In this example we simply connect Start Step to the End Step. With End Step selected on the workspace we Show Mapping Editor for this step.

showMappingRunFlow

In the Mapping Editor we expand Input on the left-hand side (our Item from the list) and connect EmailAddress field to OutputData. Save and close Mapping Editor.

mapEmailToOut

This completes our Flow For List. We can save and close Flow Designer.

runFlowCompleted

In the main Flow Designer we connect the outcome from the Run Flow For List step to the End step in the Flow. This completes our main Flow. On the top panel of the Flow Designer we click Test Flow link.

testFlow

The Flow executes in the Debugger with no errors. Input Data for the Run Flow For List step indicates that the step accepted a List of Accounts.

accountsInputs

And, the Outcome data for this step is a list of Email Addresses from the input collection Accounts.

emailsOutput

Additional Resources