Creating Subflows

You create a subflow exactly like you would create any other blank flow. Flows that were created starting with a trigger are not supported as subflows and will not be available to use as subflows.

To create a subflow, do the following:

Procedure

  1. Identify the piece of logic in your app that you want to reuse elsewhere in the app or iterate multiple times.
  2. Create a flow without a trigger for that logic. See the Creating a flow without a trigger section for details on how to create such a flow.
  3. To use this flow as a subflow within another flow, you must add a Start a SubFlow activity at the location in the calling flow from where you want to call the subflow. For example, if you want to call a subflow after the third activity in your calling flow, insert a Start a SubFlow activity as the fourth activity in the calling flow. To do so, follow these steps:
    1. Open the calling flow.
    2. On the flow details page, click the () button in the location within the flow from where you want to call the subflow. The Add Activity dialog opens.
    3. Click the the Default tab, and select the Start a SubFlow activity.

    4. Configure the StartaSubFlow activity to point to the subflow you want to call by selecting the subflow from the Select flow dropdown list in the Configuration tab.

      The schemas that you had configured in the Input Settings and Output Settings of the Flow Inputs&Outputs tab in the selected subflow appear in the Input and Output tabs of the StartaSubFlow activity.

      You can now configure the input and output for the subflow in the StartaSubFlow activity. If you add additional input and/or output parameters in the Flow Inputs & Outputs tab of your subflow, they become available to configure from the Input and/or Output tabs of the StartaSubFlow activity. The output from the StartaSubFlow activity is available for use as input in all activities that are appear after it.

      At app runtime, the Start a SubFlow activity in the calling flow calls the selected subflow.

    5. If you want your subflow to iterate multiple times, be sure to configure the iteration details in the Iterator tab of the StartaSubFlow activity. Refer to the Using the Iterator section for details on how to configure the Iterator tab.
    6. Build the app. See Building the App section for details on how to build the app.