Workflow
The Workflow Node allows a Workflow to call another Workflow. This is comparable to a function calling another function in code and permits re-use of Workflows.
To add a Workflow to your current Workflow, click +
on the Workflow Design Canvas. In the Choose Node or Workflow
dialog that displays, click the Workflow
tab and select a Workflow.
The chosen child Workflow will be presented on the Design Canvas as a Node and the input and output properties defined in Variable Bar's on the child Workflow will display as Properties on the Node.
If you change Properties in the Variable Bars of the child Workflow, you can refresh them in the parent Workflow by clicking the Node Header options button and choosing Refresh Properties
.
You can also open the child Workflow by choosing Open Workflow
from the Node Header options menu.
Parallel Workflows
Click Enable Parallel Mode
to allow multiple child Workflow invokes to occur in parallel. This pattern is useful when you want work to complete as quickly as possible.
How Parallel Invokes Work
You should use parallel mode Workflow Nodes downstream from an iterator such as For Each or Loop.
When parallel mode is enabled, the UI will be changed to show a slider representing the maximum number of instances of the Workflow that will be allowed to execute in parallel.
When the parent Workflow runs and encounters a child Workflow configured for parallel mode, the child Workflow will be spawned as a new task and execution of the parent Workflow will immediately be returned to the nearest upstream iterator (e.g. For Each Node).
The slider controls the maximum number of parallel instances of the sub-Workflow and can be scaled between 2 and 10.
Restrictions
When a Workflow is configured to run in parallel mode, none of the execution or data outputs will be available. If you need to perform additional steps after all parallel execution has completed, use the Finished
output of the nearest upstream iterator.
If you need to collate output data across multiple Workflow instances, use the Key Value Nodes to store the data within the child Workflow.
Parallel Processing and Active Workflows
In parallel mode, calls to a child Workflow run on their own thread and therefore each instance is an Active Workflow. You should consider the impact on overall Active Workflows when configuring child Workflows to execute in parallel.
When a child Workflow is about to be invoked in parallel mode, Flowgear first checks there is at least one available Active Workflow slot. If no slot remains based on the subscription the Site is allocated in to, the execution will pause until a slot becomes available.
See Sample Workflow for an example of how to implement a Parallel Workflow.
Troubleshooting Parallel Workflows
If a running Workflow Node configured to use parallel mode appears to have stopped firing up child Workflows, this is either because child Workflows have not yet finished or because there is not enough Active Workflow capacity to start a new Workflow instance.
To see how many child Workflows are running, look at the Workflow Logs for the child Node.
To see whether the Node is waiting for capacity to become available, look for these messages in the platform logs ( → Platform Logs
):
Parallel task for Workflow {workflow} cannot be started immediately because all Active Workflows are in use.
Parallel task for Workflow {workflow} is starting after a delay of {time}.