Sub-Workflows

Sub-Workflows are workflows that run in the context of another workflow. Much like the use of sub-tasks in AutoMate 7, sub-workflows allow hierarchal and modular design by creating and using collations of workflows to create larger, more elaborate and more organized "master" workflows. The Workflow Designer's Available Objects pane is equipped with a Workflow object that can be dragged onto the workspace or pre-existing workflows can be accessed from the Repository.

Debugging an embedded workflow is simple because a new tab is opened and the items in that workflow are highlighted as they run. Additionally, single-clicking an embedded workflow will show a preview image of that workflow.

To add a New Sub-Workflow to a Parent Workflow:

  1. From the WFD, drag the workflow object (circled below) from the Available Objects pane onto the workspace. A new workflow icon with a default name of Unbuilt Workflow appears in the workspace.

 

  1. Click the default name to rename the workflow.

  2. Double-click the workflow or right-click and select Edit to add/edit objects for the workflow. A new tab is opened corresponding to the new workflow.

  3. After editing the new workflow:

  1. From the parent workflow, add the appropriate arrows to point to/from the sub-workflow.

  2. When debugging a workflow that contains a sub-workflow, upon execution of that workflow, a new tab will be opened and the items in that workflow are highlighted as they run.

  3. Hovering over a sub-workflow will show a preview image of that workflow.

 

To add a Pre-existing Workflow to a Parent Workflow

  1. From the WFD, click the Repository button located at the foot of the Available Objects pane. A Repository window will appear as shown below.

  1. Expand the Workflows folder and drag the desired workflow to the workspace.

  2. Double-click the workflow or right-click and select Edit to edit the workflow. A new tab appears corresponding to that workflow.

  3. After editing the workflow:

  1. From the parent workflow, add the appropriate arrows to point to/from the sub-workflow.

  2. When debugging a workflow that contains a sub-workflow, upon execution of that workflow, a new tab will be opened and the items in that workflow are highlighted as they run.

  3. Hovering over a sub-workflow will show a preview image of that workflow.

 

Using Shared Variables with Parent and Sub-Workflows:

To follow the conventions established with tasks and sub-tasks, Shared Variables have the ability to be passed between parent and sub-workflows. See About Shared Variables for instructions on how to add a Shared Variable to a workflow. The following parameters located in the Advanced tab of the Shared Variable’s properties dialog have significant values when dealing with parent/sub-workflows:

Only shared variables with the same name (case not important) are passed between parent and sub-workflows and vice versa when the settings permit.

Behavior

The current values of the TriggeringAgent, PreviousAgent, and ConditionAgent system agents of the parent workflow are set in the embedded workflow when it runs. The DefaultAgent of the embedded workflow remains the same. The value of PreviousAgent is not propagated to the parent workflow upon sub-workflow execution completion.

A sub-workflow executes within a parent workflow if it was run manually (i.e. any triggering conditions are ignored, and any workflow item with no parent items execute).

Using AMWorkflow

When a Sub-Workflow runs in the context of another workflow, an AutoMate dataset called AMWorkflow is automatically created. This dataset can be used within a task associated to the "parent" workflow to determine specific characteristics regarding the sub-workflow, such as the name, unique ID and execution results.

AMWorkflow is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query and Get E-Mail action. For more details, see AMWorkflow

See Also

About Creating Workflows

Building a Workflow