deleting inactive flow versions using agentforce vibes

using this approach from sfse, in agentforce vibes

  1. log in to vibes
  2. create a new text file directly in the root folder. in my example i named it rmflow.sh
  3. enter the script into the file. i havent figured out how to get $USERNAME to work in vibes, so i just hard code my username
sfdx force:data:soql:query --query "SELECT Id FROM Flow WHERE Status != 'Active' AND  Definition.NamespacePrefix = '' " --target-org gsethXXX@XXX.org.dev --use-tooling-api --result-format csv > flowTodelete.csv

while read c; do
    if [[ "$c" != "Id" && "$c" != "Your query returned no results." ]]
        then
            sfdx force:data:record:delete --sobject Flow --record-id $c --target-org gsethXXX@XXX.org.dev --use-tooling-api
    fi
done < flowTodelete.csv

rm flowTodelete.csv
  1. in terminal, type chmod -x rmflow.sh (this allow you to execute the file)
  2. type ./rmflow.sh (this runs the script)

it will delete the inactive flows (and process builders for you geezers) one at a time…

Screenshot 2026-07-30 152345.png

vibes now sensibly only launches from sandboxes. so to do this for prod, you need to authenticate to prod from a sandbox, and update your username in the script.

 
0
Kudos
 
0
Kudos

Now read this

Working with Existing Attachments in Visual Workflow

You can manipulate attachments in visual workflow (i’m working with the old-fashioned attachments object, but this should work w/ files, which are stored as contentDocument / contentVersion / contentDocumentLink). What works:... Continue →