Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+

About Flow Ref

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.

Flow Ref Configuration Example

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.

flowref about 8b5d1

Enriching Content through the Flow Ref component

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 vars keyword.

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 vars.myVar.