[SalesForce] Migrate Flows with ANT migration tool

I have a process builder flow which has a 9 versions of it.

Wanted to deploy the mentioned flow through ANT migration tool and found that the flow is not deployed properly. The result is: I got 2 decisions in the source environment in and once deployed what I could see is just the 1st decision (Please see the images attached Source and the target orgs).

My attempts were;

  • Deployd just the active final version of it
  • Deployed all the versions of it
  • Changed the name/version in the xml and tried

After multiple attempts with migration tool, used a change set and diployed, this also gives me the similar results.

Can some one explain why is this happening and how could we deploy these flows through migration tool or change set as we will be end-up with multiple number of flows and we do not want to re-create each and every one in UAT sanboxes and the production environments

NOTE: before each and every attempt of deployment I deleted the flows

enter image description here
enter image description here

Best Answer

This worked for me:

  <types>
     <members>[API_NAME_OF_FLOW]</members>
     <name>FlowDefinition</name>
  </types>
  <types>
     <members>[API_NAME_OF_FLOW]-[VERSION_OF_FLOW]</members>
     <name>Flow</name>
  </types>