Learn the intricacies of workflow rules and workflow actions before you begin working with them.
Available in: Lightning Experience and Salesforce Classic
Available in: Enterprise, Performance, Unlimited, and Developer Editions
Whenever possible, automate your if/then statements with Process Builder instead of workflow rules.
Each workflow rule applies to a single object.
If you have workflow rules on converted leads and want to use cross-object field updates on the resulting accounts and opportunities, you must enable the lead setting Enable Validation and Triggers from Lead Convert.
Workflow rules on custom objects are automatically deleted if the custom object is deleted.
The order in which individual actions and types of actions are executed is not guaranteed. However, field update actions are executed first, followed by other actions.
To create workflow rules that update case fields based on new case comments or incoming email messages, choose Case Comment or Email Message from the Select Object drop-down list; Email Message is only available if Email-to-Case or On-Demand Email-to-Case is enabled. You can only create email message workflow rules for field updates, and case comment workflow rules for field updates, email alerts, and outbound messages. For example, you can create a workflow rule so that an email marked as Is Incoming changes its case's Status from Closed to New.
Changes you make to records while using Connect Offline are evaluated by workflow rules when you synchronize.
Salesforce processes rules in the following order:
Workflow rules (with immediate actions)
If a lookup field references a record that has been deleted, Salesforce clears the value of the lookup field by default. Alternatively, you can choose to prevent records from being deleted if they’re in a lookup relationship.
If you create workflow rules to replace any Apex triggers, make sure you delete those Apex triggers when you activate the equivalent workflow rules. Otherwise, both Apex triggers and workflow rules will fire and cause unexpected results, such as overwritten field updates or redundant email messages.
When Do Workflow Rules Get Triggered?
Workflow rules can be triggered any time a record is saved or created, depending on your rule criteria. However, rules created after saving records aren't triggered by those records retroactively.
Workflow rules are triggered when a standard object in a master-detail relationship is re-parented, even if the object's evaluation criteria is set to Evaluate the rule when a record is:
created, and any time it’s edited to subsequently meet criteria.
Saving or creating records can trigger more than one rule.
Workflow rules only trigger on converted leads if validation and triggers for lead convert are enabled in your organization.
Workflow rules trigger automatically and are invisible to the user. Alternatively, approval processes allow users to submit records for approval.
If your organization uses multiple languages, enter filter values in your individual language. You can add up to 25 filter criteria, of up to 255 characters each.
When you use picklists to specify filter criteria, the selected values are stored in the organization's default language. If you edit or clone existing filter criteria, first set the Default Language on the Company Information page to the same language that was used to set the original filter criteria. Otherwise, the filter criteria may not be evaluated as expected.
If you use record types in your workflow rule criteria whose labels have been translated using the translation workbench, the translated label value won’t trigger the workflow rule. Workflow criteria evaluate the master label value and ignore the translated value. To avoid this problem, set the workflow criteria to evaluate the master record type label value by entering it manually in the Value field.
Workflow rules can't be triggered by campaign statistic fields, including individual campaign statistics and campaign hierarchy statistics.
A workflow rule isn't triggered if its condition references a field that doesn't have a value. For example, if a User-based workflow rule checks “Role not equal to CEO”, the rule isn’t triggered for a user without an assigned role. Instead of conditions, use a formula to check that that the field is either null or set to something other than “CEO”:
UserRoleId == null || UserRole.Name != "CEO"
The following actions don't trigger workflow rules.
Mass replacing picklist values
Mass updating address fields
Mass updating divisions
Changing the territory assignments of accounts and opportunities
Converting leads to person accounts
Deactivating Self-Service Portal, Customer Portal, or Partner Portal users
Converting state and country data from the State and Country Picklists page in Setup
Making changes to state and country picklists using AddressSettings in the Metadata API
Workflow Rule Limitations
You can't package workflow rules with time triggers.
You can't create outbound messages for workflow rules on junction objects.
Use the Developer Console to debug workflow rules. The Developer Console lets you view debug log details and information about workflow rules and actions, such as the name of the user who triggered the workflow rule and the name and ID of the record being evaluated.
Workflow for the User Object (Beta) You can create workflow rules and actions for the User object. You can, for example, send welcome emails to new employees or sync user data with a third-party service using outbound message actions.