Question: currently I am working with Mule ESB. For now, I have 2 flow, lets say Flow 1 and Flow 2. What I need to do is generating the same correlation ID in different flow. The value of the correlation ID itself should be dynamic. I mean, the correlation ID when I run the program on the first try and correlation ID when I run the program on the second time should be different.

For example: when I send first request to my inbound the correlation ID is abcdef (in both flow 1 and flow 2), then after the first request is finish, I send the second request and the correlation ID for the second request is: xyz123455 (in both flow 1 and flow 2).

How to achieve that? Thanks in advance

Answer: 
There's no need to do anything particular to propagate the correlation ID between flows: Mule does it for you. Also, Mule generates a unique ID for each inbound message so you can just use it as the correlation ID.

Here is an example:

```
<flow name="firstFlow">
    <http:inbound-endpoint address="http://localhost:8080/test" />

    <!-- No correlation ID yet -->
    <logger level="INFO" message="CID: #[message.correlationId]" />

    <!-- Use the message unique ID as its correlation ID -->
    <set-property propertyName="MULE_CORRELATION_ID" value="#[message.id]" />

    <!-- Correlation ID is set -->
    <logger level="INFO" message="CID: #[message.correlationId]" />

    <vm:outbound-endpoint path="second.flow" />
</flow>

<flow name="secondFlow">
    <vm:inbound-endpoint path="second.flow" />

    <!-- Correlation ID is propagated -->
    <logger level="INFO" message="CID: #[message.correlationId]" />
</flow>

```

If you `curl http://localhost:8080/test` you'll see in the logs something similar to:

```
09:18:58,824 INFO connector.http.mule.default.receiver.02 [org.mule.api.processor.LoggerMessageProcessor] CID: null
09:18:58,831 INFO  connector.http.mule.default.receiver.02 [org.mule.api.processor.LoggerMessageProcessor] CID: 1c51391c-e35f-11e3-926a-9979ff687cfa
09:18:58,847 INFO  connector.http.mule.default.receiver.02 [org.mule.lifecycle.AbstractLifecycleManager] Initialising: 'connector.VM.mule.default.dispatcher.11119625'. Object is: VMMessageDispatcher
09:18:58,848 INFO  connector.http.mule.default.receiver.02 [org.mule.lifecycle.AbstractLifecycleManager] Starting: 'connector.VM.mule.default.dispatcher.11119625'. Object is: VMMessageDispatcher
09:18:58,860 INFO  secondFlow.stage1.02 [org.mule.api.processor.LoggerMessageProcessor] CID: 1c51391c-e35f-11e3-926a-9979ff687cfa

```

As you can see, the correlation ID is propagated automatically.
You could generate dynamically correlation ID in one flow (by say `UUID` class), store it as a `session variable` and use it in another flow.