Destructive Changes in Copado doesn't support Flow and Process Builder.

In API version 43.0 and earlier, the Flow object’s fullName field included the flow’s version number. In API version 44, the field no longer includes the version number. As part of this upgrade, flow definitions are no longer necessary when you deploy or retrieve via the Metadata API. This also means that the flow version is no longer retrievable, and therefore it is not included in GIt. Your Git repository will have only a single file for each flow and this one will be updated every time a new flow version is committed. For more information, check out the article How to Deploy Flows from v44.

Because of the upgrade above, if you try to use the Destructive Changes feature with a flow, you will receive the error below from Salesforce when deploying the Delete MetaData step.

"insufficient access rights on cross-reference id"

Since the flow version is no longer provided by the Metadata API v44, we don’t have access to the version anymore, and therefore we cannot specify in Copado the version of the flow that has to be deleted. As a result, flow version deletion is not supported by the Destructive Changes feature. If you want to delete flow versions, use any of the options below:

  1. Workbench or ANT Migration Tool:

In order to delete a flow version, the flow version must be specified in the destructivechanges.xml file provided to Salesforce during the deployment.

Build a zip file that contains the .xml files below (destructivechanges.xml and package.xml). By deploying this zip file, you will be able to delete the flow versions specified in the destination org.

destructivechanges.xml

<?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

   <types>

       <members>FlowName-1</members>

       <members>FlowName-2</members>

       <members>FlowName-5</members>

       <members>Example-2</members>

       <name>Flow</name>

   </types>

</Package>

package.xml

<?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">    

 <version>44.0</version>

</Package>

For more information about how to build this file, check out the article Deleting Components from an Organization.

  1. Manual task in Copado:

Create a manual deployment task in Copado to remind you that a flow version must be deleted in the destination org.


How did we do?