How to deactivate/delete flow through WorkBench API or Apex? I tried all possible ways. could anyone help out here?
-
The config switch on cloudtoolkit.co can do it. Can you explain the scenario in more detail (why via API/Apex), then we might be able to suggest differently.– GirbotJun 17, 2022 at 6:49
-
@Girbot The requirement is in the org they have some set of flows. Now they want a separate custom UI with additional description to display all the active flows. if they want to deactivate any flow they can do this with one button click– joseJun 17, 2022 at 6:55
-
This would be something like out of box functionality.– VinayJun 17, 2022 at 7:10
1 Answer
Use Workbench to retrieve metadata components and deactivate a flow, Once you retrive download those components in a .zip file and modify the flowDefinition file by specifying a value of 0 in activeversionNumber.
<?xml version ="1.0" encoding="UTF-8"?>
<FlowDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
<activeversionNumber>0</activeversionNumber>
</FlowDefinition>
Re-zip and then deploy the modified flowDefinition file.
Check more details here. For mass delete of flows check steps mentioned.
Use Ben Edwards tool 'https://sfswitch.herokuapp.com' to disable process using toggle.
Thanks
-
the following error I am getting in workbench message: You must provide a valid Metadata field for InteractionDefinitionVersion– joseJun 17, 2022 at 7:52
-