What is a sub-flow and how to use it

A sub-flow allows you to have more than one source in a flow. Multiple sources can be used to push data/ records into one or more destination/s.

Below is an example of a flow with a sub-flow. The Record Generator step is used as the primary source and Salesforce source step is used as the secondary source. The sub-flow pushes the records from both sources into a buffer as a destination.

In the Record Generator step, I created my own field called “Number” and gave it a value as shown below.

image

In the Calculator step, the Number field is being used as a parameter to pass the field with it’s value to the sub-flow as highlighted below. “NumberTest” is the created name for the parameter field.

image

In the Salesforce source step, a connection to Salesforce was created and there are certain fields that were selected from the Account object as illustrated below.

Click on the below icon in the sub-flow to choose the return value.

image

The below page will appear and you can select a Type and Source and save. I chose “Object” as a Type since my sub-flow is pulling from Salesforce as a source and I selected “Result” to show the results as an output for the sub-flow.

The output is highlighted in the below image. “NumberTest” is being passed as a parameter and the fields from Salesforce are shown as a result from the sub-flow.