---
schema_version: "1"
id: dee91a04629d3f02a57c0503a1fa811d9ef9a54487fe39b85c11effbd67383a8
title: Propagate Metadata to Other Flows
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/studio/propagate-metadata-studio.md
canonical_url: https://docs.mulesoft.com/studio/propagate-metadata-studio
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8227cc145f3ea0ec939882836cd16d2501649b0dec96aa8af98eeb308b24ae98
description: MuleSoft Documentation Site
latest: true
---
---
product: Studio
---

# Propagate Metadata to Other Flows

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

Studio enables you to propagate metadata in your source flow to other, target flows referenced
within your application. Depending on metadata already in the target flow, you might need to
configure the specific metadata to propagate from the source flow.

## Propagate Metadata to a Flow Without Custom Metadata

When you add a Flow Reference component to your source flow and reference a target flow with no
custom metadata configured, Studio automatically propagates the metadata in your source flow as
custom metadata in your target flow.

1.  In the taskbar at the top of the Anypoint Studio display, select **File** > **New** > **Mule
    Project**.

2.  Type a name for your new project and select **Finish**.

3.  Drag two flow components to your empty canvas and name them `flow-1` and `flow-2`:

    ![Two diagrams illustrating different flows, each with a source, process, and error handling step](/mulesoft/current/en-us/studio/_images/both-flows-metadata.png)

4.  Drag a Set Payload component to `flow-1` and configure the payload:

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

    ![A configuration window with a code block displaying JSON data](/mulesoft/current/en-us/studio/_images/set-payload-config.png)

5.  Drag a Logger component to `flow-2` and configure it to log `payload`:

    ![A Logger configuration with a payload message](/mulesoft/current/en-us/studio/_images/logger-payload-metadata.png)

6.  Drag a Flow Reference component to the end of `flow-1` and configure it to reference
    _\`flow-2\`_:

    ![A dialog box displays an error message and a text field for entering a flow name](/mulesoft/current/en-us/studio/_images/flow-reference-metadata.png)

7.  Note that the metadata tab in `flow-2` is now populated with autogenerated metadata, and the
    input tab in the metadata explorer reflects the payload format that the Set Payload component
    determines in `flow-1`:

    ![A screenshot displaying a message flow with metadata and an object featuring ID, departure date, empty seats, and plane fields](/mulesoft/current/en-us/studio/_images/logger-metadata-case-1.png)

## Propagate Metadata When Extracting an Operation From Your Flow to a New Flow

When you extract an operation from your source flow to propagate to a new target flow or subflow,
Studio enables you to configure the metadata that you want to propagate to the newly created flow:

1.  In the taskbar at the top of the Anypoint Studio display, select **File** > **New** > **Mule
    Project**.

2.  Type a name for your new project and select **Finish**.

3.  Drag a flow component to your empty canvas and name it `flow-1`.

4.  Drag a Set Payload component to `flow-1` and configure the payload:

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

    ![A form with fields for MIME type, metadata, notes, and help, including a text box labeled Value with code inside](/mulesoft/current/en-us/studio/_images/set-payload-flow-1.png)

5.  Drag a Logger component to the end of `flow-1` and configure it to log
    `#[payload.value.departureDate]`:

    ![A message with a payload value and departure date](/mulesoft/current/en-us/studio/_images/logger-metadata-case-2.png)

6.  Right-click your Logger component and select **Extract To…​** > **Flow**:

    ![A menu with options for a flow, including extracting the flow to a sub-flow](/mulesoft/current/en-us/studio/_images/extract-operation-metadata.png)

7.  Name your target flow `flow-2`.

8.  Select **Metadata Preferences** to configure the input and output metadata.  
    Note that Studio automatically recognizes the metadata of your flow.

    ![A window displays the input and output metadata for a message flow, which includes an object with attributes for ID, departure date, empty seats, and plane](/mulesoft/current/en-us/studio/_images/extract-flow-metadata.png)

9.  Select **OK**.

10. Your Logger component is now in `flow-2`, the metadata tab is populated with autogenerated
    metadata, and the input tab in the metadata explorer reflects the payload format that the Set
    Payload component configures in `flow-1`:

    ![A message flow with a metadata section and an input-output view that displays a message payload with object and value attributes](/mulesoft/current/en-us/studio/_images/extract-flow-metadata-final.png)

## Propagate Metadata to a Flow with Custom Metadata Already Configured

When you add a Flow Reference component to your source flow and reference another, target flow that
has custom metadata already configured, Studio prompts you to select the metadata that you want to
propagate:

1.  In the taskbar at the top of the Anypoint Studio display, select **File** > **New** > **Mule
    Project**.

2.  Type a name for your new project and select **Finish**.

3.  Drag two flow components to your empty canvas and name them `flow-1` and `flow-2`:

    ![Two diagrams illustrating different flows, each with a source, process, and error handling step](/mulesoft/current/en-us/studio/_images/both-flows-metadata.png)

4.  Drag a Set Payload component to `flow-1` and configure the payload:

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

    ![A configuration window with a code block displaying JSON data](/mulesoft/current/en-us/studio/_images/set-payload-config.png)

5.  Create a JSON file with the name _\`arrival-type-example.json\`_ in your
    `src/main/resources/examples` directory with the following format:

    arrival-type-example.json

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

6.  Select `flow-2` > **Metadata** tab > **Add Metadata**:

    ![A screenshot displays a message flow with a button to add metadata](/mulesoft/current/en-us/studio/_images/add-metadata-flow-2.png)

7.  Select **Input: Payload** > **Edit**:

    ![An arrow points to an icon for editing metadata](/mulesoft/current/en-us/studio/_images/configure-input-metadata.png)

8.  Select **Add**, create a new metadata type called _\`arrivalType\`_, and select **Create type**:

    ![A window containing a form for the creation of a new metadata type, including a type ID field and a 'Create Type' button](/mulesoft/current/en-us/studio/_images/create-metadata-type.png)

9.  Select the type **JSON** > **Example** and select the **…​** button to browse to
    `src/main/resources/examples/arrival-type-example.json`:

    ![A window with options to select a metadata type, including JSON and a text field for an example](/mulesoft/current/en-us/studio/_images/create-json-metadata-type.png)

10. Click **Select**.

11. Drag a Logger component to `flow-2` and configure it to log `payload`:

    ![A Logger configuration with a payload message](/mulesoft/current/en-us/studio/_images/logger-payload-metadata.png)

12. Drag a Flow Reference component to the end of `flow-1` and configure it to reference
    _\`flow-2\`_:

    ![A dialog box displays an error message and a text field for entering a flow name](/mulesoft/current/en-us/studio/_images/flow-reference-metadata.png)

13. Select the Flow Reference component **Metadata** tab, and select **Set Metadata**:

    ![A screenshot of a flow reference panel with the option to add metadata](/mulesoft/current/en-us/studio/_images/set-metadata-example.png)

    Studio warns you that setting the metadata from `flow-1` will overwrite the existing
    `arrivalType` metadata type configured for `flow-2`:

    ![A dialog box labeled Custom metadata inquires if you wish to replace the existing flow-2 metadata](/mulesoft/current/en-us/studio/_images/overwrite-metadata.png)

14. Select **Customize** to configure the desired metadata to propagate to the flow.

    Note that Studio recognizes the actual metadata as that set in `flow-1`, and the expected
    metadata as that configured in `flow-2`.

    ![A window that displays input and output metadata, with checkboxes for expected object values](/mulesoft/current/en-us/studio/_images/custom-metadata-configure-overwrite.png)

    Customizing the actual and expected metadata for a referenced flow is helpful if you want to
    define a specific set of metadata to propagate.
