Add a subprocess programatically into the canvas

I have a list of bpmn flows. I want to create a new bpmn flow and add a subprocess by selecting any one of the bpmn flow from the list. Is there any way to do this by using the xml of the flow and adding this xml to the main flow.

Hi @RajKumar-612 ,

Could you elaborate more on your use-case? There are multiple ways to add sub-processes on existing flows, e.g. through drag and drop:
Recording 2023-03-06 at 15.43.13