function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Darrell DeVeaux 7Darrell DeVeaux 7 

Deactivate Flow Through Apex

Does anyone have a good method to automate deactivating Flows maybe using an Anonymous script or even a scheduled class?

We have managed packages that have Flows in them and the issue is that after we install these into any org for testing, we cannot uninstall the package until we deactivate the Flow for 12 hrs (grumble). Inevitably we make changes to our package and want to uninstall and do a fresh install of the package but cannot. So we'd like to run a job each night to deactivate these Flows automatically since we can always reactivate them easily if needed.
Emilio BernabeiEmilio Bernabei
I am going to be looking for this API today, so I'll let you know what I find.
 
Dhananjay SFDC 2Dhananjay SFDC 2
Hi Darrell, till now there is no provision that we can deal with deactivating processes or flow through apex. However We can deactivate it through schema file using workbench.