As your workflow grows it may start feeling a bit unwieldy after a while. To improve the structure of the workflow you can create a subflows from some of the nodes in your workflow. Select some nodes, right-click on one of them and choose Refactor->Create subflow from selection. This will replace all the nodes that you had selected with what looks like a single node, but is actually a subflow. You can still get at the nodes by right-clicking on the subflow and choosing Edit. This will open the “inside” of the subflow in a new tab. If you want to get back to the flat workflow structure you can right-click on a subflow and choose Refactor->Expand subflow to get all the nodes back where they were before.
Subflows can also contain yet other subflows so using this feature you can structure your workflow hierarchically.
Most of the time you want your subflow to take in data on some input ports and produce output on some output ports. Each port symbol on the “outside” of the subflow is also represented inside the subflow as a triangular node-like element.
If you want to add a new input or output port simply right-click on an empty area inside the subflow and choose Ports->Input->Create or Ports->Output->Create. A corresponding port will appear on the outside of the subflow. You can connect any data type to the little question mark of the port you just created.
After you have created a subflow you can choose settings for how it should be configured. Edit the subflow and, from its inside, Right-click on the subflow and select Settings to launch a dialog for editing the current settings.
First of all choose the configuration dialogs that you want to include. The setting is empty by default but you can add any of the configuration dialogs from the nodes in the subflow. Move any nodes that you want from the list of available nodes (left hand side) to the list of selected nodes (right hand side).
You can use this to expose a portion of the configuration options for your subflow, this is helpful to hide some of the underlying details. As an example, starting out from the example workflow from Subflows you might want to expose only the configuration for a single node, such as: Update ADAF with Table and hide everything else.
There are two major modes to choose from: Wizard configuration and Tab configuration. These determine how the configuration dialog will be presented. By default Tab configuration is used. To change mode, simply check or uncheck the checkbox labeled “Configure using wizard”.
After you have created a subflow and edited its settings (See Subflow settings) you can configure it by right-clicking on the subflow and choosing Configure.
Depending on the mode, either a Wizard configuration dialog or a Tab configuration dialog will appear.
To configure without considering the configuration mode from settings right-click and choose Advanced->Configure, then choose the appropriate configuration mode.
This configuration mode organizes the selected node dialogs in tabs. When selected node dialogs include nested subflows their node dialogs will be grouped together in a tab unless there is only one dialog.
Having all selected dialogs available as tabs provides a good overview and makes it possible to quickly select the nodes of interest and configure them.
The tabs are ordered according to the order of selected nodes in Subflow settings.
This configuration mode presents a wizard showing the configuration dialogs for the selected nodes, one at a time. The nodes will be shown in dependency order and the wizard makes sure that every preceding node is executed before each selected node dialog.
Having the preceding nodes executed when configuring is useful when the content of the dialogs depends on data, for example, the column names in the input table.
Locked subflows are executed in one process without generating intermediate files for the purpose of faster execution. They are recognized by the no sign icon (a circle with backslash inside) and also by the fact that there are no numbers in the left corner showing the number of executed nodes inside divided by total number of nodes. Inside normal subflows they count as a single node.
When executed from the outside, all of the nodes inside are executed. Afterwards, any change of the configuration or content will cause the state to reset back to Armed. It can sometimes be useful to think of subflows like normal nodes, but built from other nodes. Like normal nodes, you mainly use them from the outside. Editing the inside of a locked flow, in Sympathy, would then correspond to editing the source code for a normal node. Locking subflows can help speed up the execution by avoiding costly disk operations. When editing the inside of a locked subflow it will behave like a normal subflow.
The only node ports of locked subflows that are written to disk (and generate intermediate files) are output ports from nodes connected to the top level Flow Output ports of the locked flow. Advanced: if such a node has several outputs of which only a few are connected to Flow Output ports it can, in some cases, be useful to insert Propagate First Input nodes to avoid unnecessary disk operations.
Locking and unlocking of subflows is done in the context menu for subflows. It is accessed by right-clicking and choosing Advanced->Execution mode->Locked. A check mark in context menu item indicates that the subflow is currently locked.
In addition to the most common states for nodes, see Node states, nodes executed in locked subflows have a separate state to indicate that that they are different from normally executed nodes and do not allow you to click on their ports to inspect their output data. The table below shows details for the special state for nodes executed in locked mode.
Successfully executed without disk output.
Note that executing in locked mode can significantly increase memory use, since data on intermediate output ports that would otherwise have been written to disk is kept in memory.
Subflows in the Node Library¶
Subflows can be used to build new nodes for third party libraries. This can be accomplished by saving them with filenames matching flow_*.syx in a library folder. The identifier field needs to be set on the top level flow (Right-click -> Properties: General section). Subflows used as nodes will be linked using the identifier instead of the filename. To avoid clashes, use an identifier in the following format: <library-identifier>.<flow-identifier>. This is the same format that should be used for nodes.
A subflow that is linked or that comes from the library can be missing in the currently loaded flow. Similarly to nodes, Such nodes will be shown as if they were in Error state and cannot be used until they are available. Linked subflows that are missing also show a broken link icon.
For linked subflows, the file, which is linked, is not available and must be made available before use. Afterwards the flow containing the missing subflow has to be re-opened. The file referenced is found through the node’s context menu at Properties -> Link -> Path from parent flow. This shows the relative path from the parent flow to the linked subflow’s file. Filename shows the same path converted to an absolute path. Broken file links can result from moving the parent flow or the linked subflow. Saving the parent flow in a different folder can have the same result.
Subflow ports can be marked optional, right-click on a input or output pin and choose Advanced->Properties. This will present an interface where the port can be marked as optional. Optional ports can be added to or removed from subflows. This can be useful when creating library nodes from subflows or building reusable flows for use as linked subflows.