A nested workflow is a workflow within a workflow.
A nested workflow is just another kind of service that can be added to a workflow, except that instead of it being a black box, it is a white box so you can see what is happening inside. Nested workflow contains other services inside that together perform a certain functionality and has input and output ports just any other service. So, if you are not interested in details of a nested workflow - you can just treat it as a black box that does something that you need.
It is often the case that a workflow designed for one purpose can be used again for other experiments and can be imported or merged into another workflow. Nested workflows encourage reuse and modular workflow design.
Adding a Nested Workflow
Various options on how you can add or import a nested workflow are:
- Add a new (blank) nested workflow that you intend to edit yourself.
- Import a workflow from a file on your disk as a nested workflow to your Workflow Diagram. You may edit the imported workflow if you like.
- Import a workflow from a URL as a nested workflow to your Workflow Diagram. You may edit the imported workflow if you like.
- Import an already opened workflow in the Workbench as a nested workflow to your Workflow Diagram. You may edit the imported workflow if you like.
Add a new (blank) nested workflow
By adding a new (blank) nested workflow to your Workflow Diagram, you get an empty placeholder where you can create your nested workflow functionality. To add a new workflow:
Import a nested workflow from file
To import a nested workflow from a file:
Import a nested workflow from URL
This is similar to importing a nested workflow from a file. To import a nested workflow from a URL:
Import an already opened workflow as nested workflow
This is similar to importing a nested workflow from a file or a URL. To import a nested workflow from a list of workflows currently opened in the Workbench:
Editing a Nested Workflow
Once you have added a new blank or imported an existing nested workflow to your Workflow Diagram, you can then edit it. To edit a nested workflow:
Once you have finished editing the nested workflow (and probably in the meantime as well) - save it by clicking the save icon in the toolbar or from the top menu choose File -> Save. You can also close the nested workflow an go back to your original workflow.
Saving the nested workflow saves it into the original workflow where the nested workflow was added to. It does not save it to a separate file. However, if you select "Save as" option and save the nested workflow to a file - the link to the containing wokflow is lost.
Showing and Hiding a Nested Workflow
A nested workflow is normally shown in a pale blue rectangle in the Workflow Diagram. Inside it, you can see its composing services. This view actually shows the nested workflow as a white box. To hide (collapse) a nested workflow and show it as a black box:
Merging a Workflow Into the Current Workflow
You can also merge a workflow into the current workflow. This effectively copies all services, ports and links from the source workflow directly into the destination workflow. This can be useful for copying smaller workflow fragments but you loose the modularity as the copied services are not part of a nested workflow but are “blended” in the current workflow. For inclusion of larger workflows inserting them as a nested workflow may be more beneficial.
Similarly to inserting nested workflows, you can merge a workflow:
- from a file on a disk
- from a URL in the Web
- from a workflow already opened inside the Workbench.
To merge a workflow: