Using Subflows
TIBCO Cloud Integration - Flogo (PAYG) provides the ability to call any flow from another flow in the same app. The flow being called becomes the subflow of the caller flow. This helps in separating the common app logic by extracting the reusable components in the app and creating standalone flows for them within the app. Any flow in the app can become a subflow for another flow within the same app. Also, there are no restrictions on how many subflows a flow can have or how many times the same subflow can be called or iterated in another flow. Hence, subflows are useful when you want to iterate a piece of app logic more than once or have the same piece of logic repeat in multiple locations within the app.
Here are a few points to keep in mind when creating and using subflows:
- The subflow and its calling flow must both reside within the same app. You cannot call a flow from another app as a subflow in your app.
- Since you can call any flow from any other flow within the app, you must be careful not to create cyclical dependency where a flow calls a subflow and the subflow in turn calls its calling flow. This will result in an infinite calling cycle and you will receive an error "Cyclic dependency detected in the subflow".
- Important!! You can delete any flow in an app even though the flow might be in use as a subflow within another flow. You will not receive any error messages at the time of deletion, but when you run the app, its execution fails with an error.
- You can configure the iteration details in the Loop tab of the Start a SubFlow activity. The Start a SubFlow activity iterates multiple times, resulting in the subflow being called multiple times.