Skip to main content
New tool CRON Expression Builder — preview next run times before you schedule Apex. Open the builder →
A technical diagram illustrating the steps to safely delete an approval process in Salesforce.
DevOps

How to delete approval process without breaking data

Deleting an approval process is not one click. Leave the pending requests in place and you end up with stuck records nobody can edit. Here is the order that keeps the cleanup safe.

The short answer

Deleting a Salesforce approval process safely means deactivating it, resolving every pending request, and unlocking the affected records before you remove the metadata. Work in that order and you avoid orphaned record locks, failed deployments, and broken downstream dependencies such as Apex triggers.

Key takeaways Deactivate the approval process first. It blocks new submissions and gives hidden dependencies time to surface before you try to delete anything. Query the ProcessInstance object for records with a pending status, and resolve or recall every open request, or the deletion is blocked. Check that the target records are unlocked, so users can still edit them once the approval automation is gone. Audit Apex triggers, reports and middleware integrations for hard-coded approval status values or automated field updates before you retire the logic. Run the metadata deletion in a Developer Pro or Full Sandbox with a destructiveChanges.xml file before you execute it in production.

The right way to delete approval process configurations

You're cleaning up a messy org or migrating to Flow, and you find approval process steps nobody has touched in years. It looks like a click-and-confirm job, and if you have worked in Salesforce long enough you know nothing is ever that simple. Rush it and you get locked records, broken integrations and frustrated users.

I've seen teams delete approval process metadata in production without checking for pending requests first. You end up with records stuck in a "Pending" state that nobody can edit, and a weekend spent running anonymous Apex to fix the data. Here is how to do it without the headache.

A Salesforce record locked in a pending approval state, with an active approval history list.

A Salesforce record locked in a pending approval state, with an active approval history list.

Why you shouldn't just delete approval process metadata without a plan

The "Delete" button is tempting, but Salesforce puts up guardrails for a reason. Approval processes aren't standalone logic; they are tied to record locking, email alerts and field updates. When you delete one, you're removing the instructions for how those records should behave. If you still have records sitting in someone's inbox, you're deleting the map while the hikers are still in the woods.

Deactivate before you do anything else

Salesforce won't even let you delete an active process. You have to flip the switch to Inactive first. This is your first line of defense, and it stops anyone else from submitting new records while you're doing your cleanup. I usually suggest doing it a few days before the actual deletion, just to see whether any hidden dependencies or user complaints pop up.

Dealing with the "Pending" nightmare

This is the part that usually trips people up. If there are any open approval requests, the system is going to block you, so you have to resolve them: approve them, reject them, or recall them. If you have hundreds of records, don't do this manually. Use a SOQL query in the Developer Console to find out what's still open.


SELECT Id, ProcessDefinitionId, TargetObjectId, Status
FROM ProcessInstance
WHERE Status = 'Pending'

Once you have those IDs, clear them out with a script or Data Loader. If you're dealing with complex logic, my guide to the Apex approval process covers how these instances are handled programmatically.

Steps to safely delete approval process configurations

Here is the retirement workflow I use whenever I'm cleaning up old automation. It's a bit more work upfront, and it saves you the "System Administrator" emergency call later.

Check your record locks

Approval processes often lock the record so nobody can change it while it's being reviewed. If you deactivate and delete the process while a record is still locked, that record might stay locked. Always make sure you've recalled or finished the process so users can actually do their jobs once the automation is gone.

Audit your side effects

Approval processes are famous for their "Final Approval Actions": the field updates and email alerts that happen at the end. Before you delete the process, ask yourself whether any other part of the system relies on that "Status" field being updated to "Approved". If you have a report or a dashboard looking for that value, it's going to stop updating, and you might need to replace that logic with a Flow before you pull the plug.

Pro Tip: Always check your Apex triggers. I've seen many triggers that are hard-coded to look for specific approval status values. If you delete the process, those triggers might never fire again.

Deployment and sandbox testing

Never, ever delete directly in production if you can help it. Do it in a sandbox first. Use a Developer Pro or Full Sandbox to test the deletion. If you use a DevOps tool or the Ant Migration Tool, you'll need a destructiveChanges.xml file to handle the deletion. It's much cleaner than clicking buttons in the UI, especially if you have to do this across multiple environments.

Key takeaways

  • Deactivate first: you can't delete what's currently running.
  • Clean up the data: resolve every single pending request or the delete will fail.
  • Check locks: make sure records are editable before the process disappears.
  • Watch integrations: if an external system calls this process by name, it will break.
  • History remains: deleting the process removes the logic, but the historical ProcessInstance records usually stick around for audit purposes.

A simple checklist for your next cleanup

  1. Document the current entry criteria and actions.
  2. Back up the metadata using your favorite IDE or VS Code.
  3. Set the process to Inactive.
  4. Run SOQL to find and recall all pending requests.
  5. Check for any hard-coded references in Apex or Middleware.
  6. Test the deletion in a sandbox to ensure no records stay locked.
  7. Perform the final delete approval process step in production.

Retiring old automation is a sign of a healthy Salesforce org. It's easy to keep adding new things, and the best architects are the ones who aren't afraid to remove the clutter. Just make sure you're doing it systematically. Once the old stuff is cleared out, managing the org gets a lot easier without the "ghosts" of old processes haunting your data.

Frequently asked questions

Can you delete an active approval process in Salesforce?

No, Salesforce blocks the deletion of any active approval process. You have to deactivate the process first, which also stops new records being submitted during the cleanup.

How do you find pending approval requests in Salesforce?

Query the ProcessInstance object in the Developer Console for records where Status equals Pending. You can then recall, approve or reject those requests with Data Loader or a script.

What happens to approval history when an approval process is deleted?

Deleting the approval process removes the configuration and its rules from the org. The historical ProcessInstance records remain available for audit purposes.

Why does deleting an approval process fail in Salesforce?

Usually because the process is still active, or because there are open, pending approval requests in the system. Deactivating the process and resolving every pending request clears the block.

Newsletter

One email every Tuesday

New guides, tool updates, and the release-note changes that break things.

No spam. Unsubscribe in one click.

Comments

Loading comments...

Leave a Comment