Logging the iFlow's payload
This note contains an example of a Groovy script that may help the developer trace the payload within the iFlow, especially if it changes during its lifecycle. It is worth noting that the beauty of the script below is that it adds an attachment to the processed message that can be found on the BTP Monitor dashboard.
Groovy Script to Add the Attachment of the iFlow's Payload
Please see the example of the Groovy script below.
See Create a Script Step to Log the Payload
By adding the above script to your iFlow, you should be able to get the payload attached to the processed message when you open it on the Monitoring dashboard.
Testing
To understand how it works, you may create a simple iFlow.
Change the payload at one of its steps, deploy the changes, trigger the endpoint, and observe the results.