Deactivate flow using Copado

Is it possible to deactivate a flow using Copado?

Unfortunately, this cannot be done with the Metadata API.

After the changes introduced in the Salesforce's API 44, you will move the latest version of the flow in the state it was in the source environment creating a new version in target. The problem is that you will always create a new version on top of the previous one.

Let's think in the following scenario: you have, the version 5 of a Process Builder as active in target and you want to deactivate de flow in the target environment, so you deploy a new version as inactive. After the deployment, you will have in target the newly created version (named as "version 6") as inactive, but the version 5 will remain as active, so the entire flow will be active.
User-added image User-added image

Please, bear in mind this is not a Copado issue, but a limitation of the metadata API. You will see the same behavior with ANT or Workbench.

How did we do?