Skip to content

Subflows

Working of a subflow

A subflow is a set of nodes which can be bundled together for re-using later like a function. The subflows can be used in multiple larger flows as a single node which in turn reduces the complexity in a flow.

The subflow feature in VFC is an adaptation of the "subflow" in Node-RED. For more information, refer to Node-RED subflows.

User interface of a subflow

ui-subflow

① Node palette where subflow nodes are created under "subflows"

② Working area to design subflows

③ Sidebar

④ Tools menu

Create a subflow

You can design subflows using the two methods:

  • Create a new subflow
  • Selection to subflow

Both the methods are described below.

The subflow option is available in the menu bar menu bar.

Create a subflow

To create a subflow, proceed with the following steps:

  1. Click the menu bar option and choose the subflows option. Select "Create Subflow".

    create-subflow-window

  2. Create a new subflow as required.

  3. Click edit properties to set the name and description of the subflow. This is optional.

Result

A new subflow will be created and will be visible in the node palette under section "subflows".

subflow-section

You can now use the created subflow as a single node in other flows.

Selection to subflow

You can create a subflow while designing a flow.

Let us consider the following flow:

timestamp-generate-array

Proceed with the following steps to create subflows while designing a current flow:

  1. Select the "generate" and "filter" nodes.
  2. Open the menu bar menu bar and select the "Selection to Subflows" option.

    selection-to-subflow

Note

The "Selection to subflow" option will be visible only when you select the nodes in your working space.

3.Double click the created subflow and edit if required.

edit-flow-template

Note

Clicking delete button removes the subflow from your current working space and not from the node palette.
To delete subflows from the node palette, refer to Delete subflows.

Result

  1. The selected nodes will automatically be converted to a subflow.

    input-subflow-map-array

  2. The newly created subflow will be visible in the node palette.

    subflow2

Edit a subflow

There are two ways to edit properties of a subflow:

Edit from Node Palette

Double click the node from the palette under "subflow" section. Click edit properties and edit the subflow properties as required.

Edit from currently opened subflow

Open the working subflow and click on edit properties to edit the subflow properties.

Inputs and outputs

You have the option of designing flows at most with one input input.

But flows can be designed with as many outputs as required Output.

Delete a subflow

You can delete a subflow when it is no longer required.

Double click the required subflow from the node palette and select delete subflow from the subflow working space. Once you delete the subflow, it will no longer be visible in the node palette.


Last update: April 23, 2024