Skip to main content

Hi,

 

I am trying to disable the flows using the flow definition file by setting activeVersionNumber to 0 and I am getting success but when I am trying to enable it back by setting activeVersionNumber to 1 which is flow's current version, I am getting success but the flow is not getting active. Why?

I looked at the documentation: https://developer.salesforce.com/docs/atlas.en-us.236.0.api_meta.meta/api_meta/meta_flowdefinition.htm?_ga=2.252330703.774934223.1709288116-1717008481.1675673607. Here it is mentioned that In API version 44.0, we recommend upgrading your flows to flow metadata file names without version numbers and discontinue using the FlowDefinition object to activate or deactivate a flow. Then use the Flow object to activate or deactivate a flow.

 

So I also used status field of flows to deactivate using obsolete and to activate using Active as per the recommendation here - https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_visual_workflow.htm#md_flow_upgrade.

 

However it neither disabled nor enabled the flows. It looks like this is not metadata API compatible as per https://gearset.com/blog/deactivate-flows-within-your-data-deployments/

 

Now I am stuck what exactly we need to do. Please help me here. 

2 件の回答
  1. 2024年3月12日 4:31

    Hi @VINAY KUMAR K,

     

    Like I mentioned in my post, I tried with workbench and find that disabling of flows using activeVersionNumber works by setting it to 0 but enabling of flows does not work and we set activeVersionNumber to the previously activeVersion.

     

    I am not sure, what should be the way to achieve it.

     

    Thanks!

0/9000