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 Node-RED subflows.
User interface of a 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 .
Create a subflow¶
To create a subflow, proceed with the following steps:
-
Click the menu bar option and choose the subflows option. Select "Create Subflow".
-
Create a new subflow as required.
- Click
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".
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:
Proceed with the following steps to create subflows while designing a current flow:
- Select the "generate" and "filter" nodes.
-
Open the menu bar
and select the "Selection to Subflows" option.
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.
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¶
-
The selected nodes will automatically be converted to a subflow.
-
The newly created subflow will be visible in the node palette.
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 and edit the subflow properties as required.
Edit from currently opened subflow¶
Open the working subflow and click on to edit the subflow properties.
Inputs and outputs¶
You have the option of designing flows at most with one input .
But flows can be designed with as many outputs as required .
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 from the subflow working space. Once you delete the subflow, it will no longer be visible in the node palette.