On this page
- Step 1: How do I list every flow in my org?
- Step 2: How do I find inactive flows and old versions?
- Step 3: What do I do about Process Builder and Workflow Rules?
- Step 4: How should I name flows?
- Step 5: Where do fault paths go?
- Step 6: How do I test a flow cleanup in a sandbox?
- Step 7: How do I deploy flow changes safely?
- Step 8: How do I keep flows clean afterwards?
- Where does Clientell AI help with flow cleanup?
- Sources
- Common questions about Salesforce flow cleanup
To clean up Salesforce flows, list every flow and delete old versions. Then migrate Process Builder and Workflow Rules, rename, add fault paths, test in a sandbox and deploy in small batches. Flow cleanup is the work of making every active flow named, owned, tested and needed.
Clientell AI, the AI agent for Salesforce admins and teams, maps every flow in your org and what it touches, and drafts the cleanup. Start with the free Flow audit, which is read-only.
Step 1: How do I list every flow in my org?
Start with a full inventory. In Setup, open Flows and sort by Last Modified. For a list you can export, run this query on the FlowDefinitionView object in the Developer Console, with the Use Tooling API box checked (Object Reference):
SELECT ApiName, Label, ProcessType, ActiveVersionId, LastModifiedDate FROM FlowDefinitionView
Copy the result into a sheet. Add three columns: owner, object touched, and decision. For each flow, write one line on what it does. If you cannot write that line, the flow goes on the "investigate" list.
Use this table to make the decision:
Swipe sideways to see all columns
| What you find | Decision | Next step |
|---|---|---|
| Active, has an owner, has a description | Keep | Add a fault path if missing |
| Active, but writes the same field as another flow | Fix | Merge into one flow per object and trigger |
Blank ActiveVersionId, not edited in a year | Retire | Export the metadata, then delete |
| Process Builder or Workflow Rule still active | Fix | Migrate to Flow (Step 3) |
| Nobody can say what it does | Investigate | Read the debug log on a test record |
Expected result: every row has a decision and an owner. Nothing gets deleted in this step.
Step 2: How do I find inactive flows and old versions?
A flow with an empty ActiveVersionId has no active version. It does nothing today. Check why before you delete it. It may be a draft someone is still building.
Old versions are a separate problem. Each save of an active flow creates a new version, and one flow can hold at most 50 versions (Salesforce Help: Flow Limits). Find old versions with this Tooling API query:
SELECT Definition.DeveloperName, VersionNumber, Status FROM Flow WHERE Status = 'Obsolete'
In Setup, open the flow, then delete obsolete versions you no longer need as a rollback point. Keep the previous version of any flow you changed this month. Export a flow's metadata before you delete the last copy of anything.
Step 3: What do I do about Process Builder and Workflow Rules?
Migrate them. Salesforce no longer supports Workflow Rules and Process Builder as of 31-12-2025. They may keep running, but support is gone and bugs will not be fixed (Salesforce Help). Salesforce offers a Migrate to Flow tool in Setup > Migrate to Flow (Salesforce Help: Migrate to Flow).
Use this order:
- List every active process and workflow rule, grouped by object.
- Pick one object at a time. Merge its rules into one record-triggered flow where you can.
- Run the Migrate to Flow tool on one rule and read the result. Treat it as a first draft. What the tool skips is worth reading first.
- Test the new flow in a sandbox with the old rule still active there.
- Turn off the old rule, activate the flow, and watch the object for a week.
Never run an old rule and its replacement together in production. Both will fire on the same save.
Step 4: How should I name flows?
Pick one pattern and apply it to every flow. For example: Object_Trigger_Purpose, such as Opportunity_AfterSave_SetStage or Case_Scheduled_CloseStale. The name should tell you the object, when it runs and why.
Rename in the Label, then check the API name. Changing an API name affects anything that calls the flow, such as a subflow or Apex. Search for callers first. Put a short description on every flow, so the next admin does not have to open it.
Step 5: Where do fault paths go?
Put a fault path on every element that reads or writes data: Create Records, Update Records, Delete Records and Get Records (Trailhead: Fault Paths). Without one, a failure shows the user a generic error and your team learns nothing.
A good fault path does two things. It logs the error somewhere you check, such as a custom Flow_Error__c object or an email to the admin queue. It then ends the flow in a clear way. Store $Flow.FaultMessage, the flow name and the record Id, so you can find the failing record.
Step 6: How do I test a flow cleanup in a sandbox?
Never test cleanup in production. Refresh or use a sandbox that holds a copy of the objects the flows touch. Then:
- Open each changed flow in Flow Builder and use Debug with a real record.
- Test the paths that people forget: a record with empty fields, a record owned by an inactive user, and a bulk update through Data Loader.
- Check the same reports before and after.
- Check validation rules and other flows on the same object. Two flows that update the same field can overwrite each other.
Write down each test record, the field you checked and the value you saw. Expected result: the same values before and after the cleanup. Attach that list to the change request.
Step 7: How do I deploy flow changes safely?
Deploy in small batches. One object at a time is a good size. Deactivate before you delete. Keep a flow off for a full business cycle, such as a month-end close. That catches the automation that only runs then. Delete only after nothing breaks.
Keep a way back. Export the flow metadata first, and keep the old version until the next release passes without complaints. If a deploy breaks something, open the flow, pick the previous version and click Activate. That is a one-minute undo. Tools such as DevOps Center, Gearset or Clientell Platform can deploy for you. For a comparison, see our guide to Salesforce DevOps tools.
Step 8: How do I keep flows clean afterwards?
Add a short rule to your change process. Every new flow gets a name, a description, a fault path and one owner. Review the flow list each quarter. Retire anything with no active version and no caller.
Flows are one part of automation debt. Our technical debt guide covers old Apex, unused fields and profiles too.
Where does Clientell AI help with flow cleanup?
The hard part of cleanup is knowing what a flow touches. Clientell AI builds a context graph of your org, a live map of every object, field, flow and permission. It finds every flow, shows which fields and records each one reads and writes, and lists what would break if you retire it.
Then it drafts the changes: the migration, the rename, the fault path. Platform deployments have rollback. You can also run it from your own Claude client through Clientell MCP. Read more on security and privacy.
Try it in Clientell AI: "List every inactive flow, every flow without a fault path, and every active process."
Start the 14-day trial, no card needed. Clientell MCP is $249 a month and Clientell Platform is $500 a month. See pricing.
Common questions about Salesforce flow cleanup
Is it safe to delete inactive Salesforce flows?
Only after you check why they are inactive and confirm nothing calls them. Deactivate first, wait a business cycle, export the metadata, then delete.
Do Workflow Rules and Process Builder still work?
They can still run, but Salesforce ended support for them on 31-12-2025. Support is gone and bugs will not be fixed, so migrate the ones you rely on.
How many flows should one object have?
Fewer is easier to reason about. Many teams aim for one record-triggered flow per object and trigger type, and move branching inside it. Pick a rule and document it.
What is a flow fault path?
It is the route a flow takes when an element fails. Without it, the user sees a generic error and you get no useful log.
Can an AI agent clean up flows for me?
Yes, if it reads your org first, drafts each change and tests it in a sandbox. Clientell AI asks before it changes anything in production.
Sources
Salesforce documentation
- End of Support for Workflow Rules and Process Builder
- Migrate to Flow
- Flow Limits and Considerations
- Handle Flow Errors with Fault Paths
- FlowDefinitionView Object Reference
Last reviewed October 2026
Last updated: October 22, 2026



