Subflows

You can create subflows within a workflow. Subflows do not create new events. This means that you can freely share context, status, outputs, and errors between subflows and parent workflows.

Subflows should not set the status of the event; the event is created for the parent workflow because subflows do not have separate events. The status change is reflected in the parent workflow and the subflow should return to the parent workflow. You must complete any status changes in the parent workflow.

Subflows enable you to limit the context by explicitly mapping the context from the parent workflow to the input and output parameter of the subflow. This creates a cleaner workflow free of side effects.

Subflows can have work items and suspend the workflow. Subflow (applies to synchronous workflow only) suspension suspends the parent workflow as well. However, when such work items time out, the subflow is restarted and completed. Unless the subflow is suspended again, the parent workflow assumes that the subflow has completed and resumes. To avoid this behavior, you need to suspend the subflow by calling out suspend in the transition.