Flow Reference Component
Flow Ref routes the Mule event to another flow or sub-flow and back within a same Mule application. This lets you treat the entire referenced flow like a single component in your current flow.
Flow Ref breaks up the Mule app into discrete and potentially reusable units. For example, a flow that lists files on a regular basis might reference another flow that processes the output of the List operation. Instead of appending all the processing steps, you can append a Flow Ref that points to the processing flow.
In this example, the Flow Ref component points to a sub-flow called ProcessFiles.
The diagram below shows the order of processing when one flow references another. When the main flow is triggered, the Mule event travels through and executes the flow until the event reaches Flow Ref. The event then travels through and executes the referenced flow from beginning to end, and returns to the main flow.
The Flow Ref component can specify a Target variable, which allows you to define a variable to hold the output of the referenced flow. You can then access that output through the
For example, if a Flow Ref in your main flow points to a flow that produces the value of a certain field that is unavailable in the main flow, you can configure the Target variable (such as
myVar) in the Flow Ref component to store the value of that field so that you can use that value in your main flow using