How to save an xml of the process instance everytime it ends ?

I’m diving into the world of Camunda and I’ve got an exciting process ready to roll. :rocket: Here’s the scoop: I want to ensure that every time an instance of my process ends, the XML gets saved with all the juicy variables included. :memo: Why? For top-notch traceability, of course!

Could any Camunda champions out there lend a hand? How can I achieve this in Camunda 7? Any guidance or tips would be massively appreciated! :pray:

Thanks a million in advance! :star2:

When a process completes it already has a lot of meta data about the process definition, version and variables contained throughout the fun as well as a log showing the path. It’s probably not necessary to also export the XML of the BPMN if you already have a reference to it

Thank you, Niall, for your prompt response to my post on the Camunda community forum! Your help is greatly appreciated.

For traceability purposes, I would like to retrieve the details of each Camunda process instance that has completed. Specifically, I want to track the paths or branches that each instance took during its execution. For exemple, if my process includes multiple exclusive gateways (XOR gates) and event based gates, I would like a mechanism to trace each path taken by the Camunda instance when it reaches its end state.

do you have any idea ?