Deleting Flow versions with Gearset

PHOTO EMBED

Wed Aug 26 2026 18:05:34 GMT+0000 (Coordinated Universal Time)

Saved by @selmo

<?xml version ="1.0" encoding="UTF-8"?>
<FlowDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
    <activeversionNumber>0</activeversionNumber>
</FlowDefinition>
content_copyCOPY

At the time of writing, it's not possible to deactivate a flow using the Flow object itself through the Metadata API. However, you are able to use a workaround to deactivate a Flow via the Metadata API. Even though Salesforce doesn't recommend using them anymore, you'll use the Flow Definition to deactivate the Flow. ​ To deactivate a Flow via the API, set the activeVersionNumber to 0 in the Flow Definition, like shown below

https://docs.gearset.com/en/articles/2439855-changes-to-flows-in-v44-of-the-metadata-api