There are two ways to execute parallel subflows with Flow:
At certain points in your flow, you may want to execute one or many flows automatically on behalf of the user. In this situation, the builder of the flow wants to make sure certain “sub-processes” are started due to the current state of the parent flow.
For example, based on an order being raised in the parent flow, you need to ensure that the Compliance, Legal and Procurement teams are all completing their subflows in parallel, and that these subflows are completed before the order can be provisioned to the customer.
System-based subflows give you the ability to have “parallel execution”, in that you can get users working on a sub-set of things independently, but connected to the parent flow.
At certain points in your flow, you may want to allow the user to come out of the parent flow and start working in a child flow. This is often the case when there are “n” number of subflow things that need to be completed before a parent flow can continue. For example, you want to create an “inbox” of flows where various team members will complete their flows independently. As the subflows are completed, a user will use the inbox to monitor status and proceed once the subflows are at the requisite stage. User-based subflows give you the ability to have a “parallel UI”, in that users can work on a sub-set of things independently, but connected to the parent flow.
There’s nothing specific that needs to be done to create a subflow. A subflow is simply a flow that’s being called from a parent flow. There are basically two parts to executing subflows in parallel:
- Execute: You use a message to execute the subflow. This returns a state value that you can use to get information about the subflow State.
- Listen: You use a separate message to listen to the subflow state. This allows you to create outcome rules to determine whether or not the parent flow should proceed.
The reason we’ve separated the execution from the listening is because it is useful to be able to execute subflows, but allow the parent flow to continue with additional execution/user operations. At some point in the parent flow, you may then wish to only proceed if the subflows, executing in parallel, have completed or reached a particular step.