Question: what is the best way to ensure payload state is maintained during a flow execution. I have a flow that performs multiple database and webservice executions, but everytime i perform a connector execution my payload gets lost. to maintain this. 
To maintain state, all my connector executions are being performed in a message enricher scope and the responses from these outbound connectors are populated in variables. Even though I feel these are a complete waste of memory.

kindly advise.

regards
Santosh

Answer: 
What would you be doing with the results of these other db / ws calls if you didnt put them in flowVars? Where would you like to hold them?

You are probably doing the right thing to use MessageEnricher if you dont want to loose the original payload. 

If you didnt want to put the results of each enricher in vars, you could add them to the message payload itself. If the payload is an instance of map or a pojo with a setter, you can simply add an enrichers result as in:

```
 <enricher source="#[message.payload]" target="#[message.payload.enricherResult]" doc:name="Message Enricher">

```

If you wanted to keep the payload original, you could move it into a map as key "original" or something and then add each enrichers result as a new key.

Either way, the fact that you plan to hold on to each enrichers result probably means the same amount of memory is being used whether you put them in flowVars or stuff them into the payload itself.
An alternate and simple approach will be, save the message payload into some variable before a DB call or external service call.  

You can later retrieve the value from the variable and set it as payload