---
schema_version: "1"
id: 3518e7c0406a3b8325b9180062b6025884505c27eef12081ca2e12934f3f651f
title: Reuse Flow Metadata in Referenced Flows
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/studio/metadata-propagation-between-flows.md
canonical_url: https://docs.mulesoft.com/studio/metadata-propagation-between-flows
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 107b85aece19f6d21af33c2eea9450ce79c220a0041d7a143d7af382bd47d3f7
description: MuleSoft Documentation Site
latest: true
---
---
product: Studio
---

# Reuse Flow Metadata in Referenced Flows

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Anypoint Studio 7.12 infers the metadata of your flow so that, when you use a Flow Reference
component to reference another flow, you can set the metadata from your flow as custom metadata for
your referenced flow.

Using the Flow Reference component in Anypoint Studio enables you to automatically rather than
manually propagate metadata in your flow to the flow referenced by it.

When you use Studio to scaffold your flows based on a RAML specification, Studio infers the metadata
of your flow based on your RAML specification’s types. However, because Union types are not
supported, Studio does not infer your Union type values as metadata.

For example, consider a flow named `flow-1` that uses a Set Payload component to create a JSON
payload:

Actual Metadata Sample

```JSON
{
  "value": {
    "ID": 1,
    "departureDate": "2016/12/20",
    "emptySeats": 200,
    "plane": {
      "type": "Boeing 747",
      "totalSeats": 400
    }
  }
}
```

When you add a Flow Reference component to a second flow, `flow-2`, Studio detects the metadata in
`flow-1` as the actual metadata that the referenced flow receives and automatically assigns it as
custom metadata in `flow-2` if the flow does not already have custom metadata declared for it.

Because the metadata in `flow-2` is set once, it can’t update automatically if you modify the
metadata in `flow-1`. For this example, if you choose to modify the actual metadata sample for the
Set Payload component in `flow-1`, you must update the custom metadata in `flow-2`.

Consider now that `flow-2` has custom metadata configured already using the following JSON example:

Expected Metadata Sample

```JSON
{
  "value": {
    "ID": 1,
    "code": "GQ574",
    "price": 399,
    "departureDate": "2016/12/20",
    "origin": "ORD",
    "destination": "SFO",
    "emptySeats": 200,
    "plane": {
      "type": "Boeing 747",
      "totalSeats": 400
    }
  }
}
```

Studio considers the custom metadata of `flow-2` as the expected metadata for the referenced flow,
and the metadata set by the Set Payload component in `flow-1` as its actual metadata. You can choose
to either overwrite the expected metadata with the actual metadata, or customize it so that you
choose what metadata you want to overwrite, and which metadata you want to preserve.
