Before-Save Flow
Learning Content
Last updated: July 21, 2026
Before-Save Flow
A Before-Save Record-Triggered Flow is a type of Salesforce Flow that executes before a record is saved to the database. It is primarily designed to update field values on the same record quickly and efficiently before the database save operation occurs.
Because the record has not yet been committed to the database, Salesforce can modify the record in memory without performing an additional database update. This makes Before-Save Flows one of the fastest automation tools available on the Salesforce Platform.
💡 LearnFrenzy Insight
Imagine filling out an online application form.
Before you click Submit, the system automatically formats your phone number, capitalizes your name, and fills today's date.
The record is updated before it is stored.
That's exactly how a Before-Save Flow works.
Where Does Before-Save Flow Execute?
User Clicks Save
│
▼
System Validation
│
▼
⭐ Before-Save Flow
│
▼
Before Trigger
│
▼
Validation Rules
│
▼
Database Save
Before-Save Flows execute early in the transaction, allowing field values to be updated before Apex Triggers and before the record is written to the database.
Why Use a Before-Save Flow?
| Reason | Benefit |
|---|---|
| Fast Performance | Updates field values before the record is saved, avoiding an extra database update. |
| No Additional DML | Changes are included in the initial save operation. |
| Declarative | No Apex code is required for simple field updates. |
| Easy Maintenance | Business users and administrators can maintain the logic using Flow Builder. |
Common Use Cases
| Scenario | Example |
|---|---|
| Default Values | Automatically set Opportunity Probability. |
| Formatting | Convert customer names to proper case. |
| Field Calculations | Calculate a discount before saving. |
| Data Standardization | Normalize phone numbers or postal codes. |
| Business Defaults | Populate Sales Region based on Country. |
Real Business Scenario
🏢 Business Example
Whenever an Opportunity is created:
- If Probability is blank, set it to 10%.
- If Stage is "Qualification", automatically assign a default Follow-Up Date.
- Format the Opportunity Name according to company standards.
All these updates happen before Salesforce saves the record.
When Should You Use Before-Save Flow?
| Use Before-Save Flow | Avoid Before-Save Flow |
|---|---|
| Update the same record. | Create related records. |
| Populate default values. | Send emails. |
| Simple calculations. | Call external APIs. |
| Field formatting. | Update child records. |
| Data normalization. | Complex multi-object automation. |
Before-Save Flow vs Before Trigger
| Feature | Before-Save Flow | Before Trigger |
|---|---|---|
| Requires Code | No | Yes |
| Performance | Very Fast | Fast |
| Best For | Field updates on the same record | Complex business logic |
| Maintainability | Easy | Requires Apex knowledge |
| External Integrations | No | Possible with Apex (subject to transaction design) |
🔍 Behind the Scenes: What Happens Internally?
User Clicks Save
│
▼
Salesforce Creates Record in Memory
│
▼
Before-Save Flow Executes
│
▼
Field Values Updated
│
▼
Record Continues Through Execution Flow
│
▼
Database Save Happens Later
Notice that the database has not been updated yet. Salesforce modifies the in-memory version of the record first, which is why Before-Save Flows are highly efficient.
✅ Best Practice
Use Before-Save Flows whenever you need to update fields on the same record before it is saved. This keeps automation fast, declarative, and easier to maintain.
⚠️ Common Mistake
Trying to create related records, send emails, or perform complex cross-object processing in a Before-Save Flow. These scenarios are better suited to After-Save Flows or Apex.
🎯 Interview Tip
A common interview question is:
"Why is a Before-Save Flow faster than an After-Save Flow?"
Because it updates the record before the database save operation, avoiding an additional update (DML) on the same record.
📌 Quick Revision
- ✔ Executes before the database save.
- ✔ Best for updating fields on the same record.
- ✔ No additional DML required.
- ✔ Faster than After-Save Flow for field updates.
- ✔ Cannot be used for creating related records or sending emails.
➡ Next Lesson
In the next lesson, you'll learn about Before Trigger, including how it differs from Before-Save Flow, when Apex is the better choice, and how both fit into the Salesforce Order of Execution.
Practice What You've Learned
Test your understanding with these practice exercises