How would you create a Flow that triggers when a record is deleted?

Overview

Record deletions can be important events — you may need to log deletions, notify owners, or clean up related records. Salesforce Flows support triggers for deleted records using a Record-Triggered Flow. This post explains, step-by-step, how to build a Flow that runs when a record is deleted and best practices to follow.

When to use a delete-triggered Flow

Use a Record-Triggered Flow on delete when you need to:

– Audit or log the deleted record (create an Audit object or Custom Object entry).

– Notify users or external systems about the deletion.

– Cascade cleanup of related records (create follow-up records, remove references) where possible.

Limitations & considerations

– The deleted record no longer exists in the database; use the record context values supplied to the Flow to access field values from the deleted record.

– You cannot perform before-delete logic that prevents deletion using a Flow — use an Apex before delete trigger if you must stop the delete.

– Avoid heavy data operations inside delete flows that can cause performance issues — prefer bulk-safe actions.

Step-by-step: Create a Record-Triggered Flow for deletion

1) Open Flow Builder

From Setup > Process Automation > Flows, click New Flow.

2) Choose flow type

Select Record-Triggered Flow and click Create.

3) Configure the trigger

On the trigger configuration panel:

– Object: choose the object you want to watch (for example, Account).

– Trigger the Flow When: select A record is deleted.

– Optimize the Flow For: choose Actions and Related Records (typically the proper choice for post-save actions). Note: when selecting delete, the Flow will operate after the record is removed.

4) Access deleted record values

The Flow provides access to the deleted record’s field values through the record variable available in the Trigger context. Use those values to perform downstream actions (create audit records, look up related data using the record Id, send notifications with field details).

5) Add actions

Common actions:

Create Records to write an audit entry (e.g., Deletion_Audit__c) capturing key fields and who deleted the record.

Send Email or Post to Chatter to notify stakeholders.

Get Records + Delete Records to clean up related child records (be careful with recursive deletes).

6) Save & Activate

Save the Flow, give it a meaningful API name and description (include the object and reason — helps with governance), then Activate it. Test in a sandbox first using sample records and the Debug logs.

Example use case (Account deletion audit)

Flow actions (high-level):

1. Trigger: Account — A record is deleted.

2. Create a Deletion_Audit__c record with fields:

Account_Name__c = $Record.Name
Deleted_By__c = $Flow.CurrentUser
Deleted_On__c = $Flow.CurrentDate
Account_Id__c = $Record.Id

3. Send email to account owners or system admins with summary details using $Record field values.

Testing tips

– Use a sandbox and run tests with multiple records to ensure bulk behavior.

– Monitor Flow interviews in Setup > Paused and Failed Flow Interviews and use debug logs to inspect values at runtime.

When to use Apex instead

If you need to prevent deletion, perform complex transactional logic before a record is removed, or need finer control over recursion and bulk behavior, use an Apex before delete trigger. Flows are best for configuration-first, post-delete actions like logging, notifications, or light cleanup.

Summary

Creating a Flow that triggers on record deletion is straightforward: build a Record-Triggered Flow, choose A record is deleted, add downstream actions that use the deleted record’s context values, test thoroughly, and be mindful of limitations where Apex might be required.