mulemulesoftmule4cloudhub

How to trigger a flow during undeployment of a Mule application in CloudHub?


I am working on a use case to trigger a specific flow that should trigger only when undeployment of the application happens from CloudHub.

I found an article that has script and am using the same to find out the flow start:

https://docs.mulesoft.com/scripting-module/2.0/scripting-module-examples

Can you help me to find out the way to trigger a flow after undeployment is initiated from CloudHub?


Solution

  • There is no way to do that. The script execution happens inside a flow execution, that is probably triggered by a scheduler at startup. There is no way to trigger a flow at shutdown of the Mule application. Note that it should be at shutdown, because undeployment is a CloudHub event that the Mule Runtime is not aware of. At undeployment CloudHub commands Mule to shutdown the application.