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
roni shoreroni shore 

Deactivate workflows through Metadata API

Hi Guys -can someone please suggest, how we can activate and deactivate workflows through metadata api in Apex
Raj VakatiRaj Vakati
To activate a flow, modify the metadata object and set the activeVersionNumber to the version number to activate. To deactivate an active flow version, set the activeVersionNumber to 0 (zero) or omit the value


https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_flowdefinition.htm

https://andyinthecloud.com/2013/03/10/apex-metadata-api-spring13-update-org-settings-access/
https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_workflowrule.htm