Before Save Workflow
A Before Save Workflow lets you run business logic before a record is saved to the database. Instead of waiting until after a record is committed, this feature ensures only correct and complete data is stored.
With a Before Save Workflow, you can:
- Validate data
- Set default values
- Automatically update field values
- Apply business rules or calculations
- Prevent saving invalid data by showing custom error messages
It reduces the need for custom code and provides admins with an easy way to enforce validations or apply updates in a single flow. The workflow also supports bulk operations, efficiently processing 500–1,000 records during large-scale updates.
Supported Activities
When configuring a Before Save Workflow, you can use the following activities:
- Update Record – Modify field values before saving
- Decision – Define conditions and direct the workflow to the appropriate path
- Custom Error – Block saving and display error messages
- Maximum of two published workflows per object; you can create more, but only two can be active at a time.
- Workflows run in the order they were published (the first published runs first).
- Error display depends on the application (example: CLM, CPQ).; errors may appear as pop-ups or inline messages based on configuration
- In bulk imports (CSV/API), errors are logged per record index instead of showing inline in real time.
- Cross-object formulas are not supported, and only string-type resources are allowed in Custom Error activities.
Configuring a Before Save Workflow
Your workflow is now accessible from the workflows list. After the workflow is executed, you can view the workflow instances on the Instances tab. For more information, see Working with Workflow Instances.
Use Case: Automating Quote Validation and Approvals
Sales teams often create Quotes with varying discount levels, pricing thresholds, and contract details. Without proper controls, this can lead to errors, missed approvals, or incomplete records being saved. A Before Save Workflow ensures that every Quote meets business rules before it is saved.
- Automatically sets Discount % based on the Quote's Grand Total, ensuring consistent pricing rules are applied.
- Flags approval requirements when the Net Amount exceeds a defined threshold, so high-value deals always go through the approval process.
- Validates mandatory fields like Expected Start Date to ensure critical information is captured.
- Prevents incomplete or non-compliant Quotes from being saved until errors are corrected.
Record Trigger (Quote Create)
The workflow starts whenever a Quote is created, ensuring all rules run before the record is saved.
Decision: Approval Required for Net Amount > 75,000
If the Net Amount is greater than 75,000, the workflow marks the Quote as requiring approval. Otherwise, it moves to discount calculation.
Update Record: Set Approval Status to Approval Required
When the Net Amount exceeds 75,000, the field Approval Status is updated to Approval Required.
Decision: Discount Based on Grand Total
The workflow evaluates the Quote's Grand Total and selects a discount tier:
- 10% discount
- 15% discount
- 5% discount (default)
Update Record: Apply Discount %
The workflow applies the selected discount automatically, ensuring consistent pricing rules without manual entry.
Decision: Check Expected Start Date
The workflow verifies that the Expected Start Date field is filled in.- If present – the workflow ends successfully.
- If missing – the workflow triggers error.
Custom Error: Expected Start Date Missing
If the Expected Start Date is missing, the workflow displays an error and prevents the Quote from being saved.
