Experience Salesforce
Workflows in Salesforce
What You’ll Learn
- What are Salesforce Workflow Rules?
- Salesforce Workflow Rules Components
- Actions in Salesforce Workflow Rules
- Types of Actions Available in Workflow Rules
- How to Configure Workflow Rule Criteria?
Businesses nowadays struggle to keep ahead of the curve in the fiercely competitive and ever-changing commercial climate. To succeed, they must not only increase profitability and competitiveness but also strengthen resilience and agility.
One of the main tactics for overcoming these obstacles is process automation. It is applied to software or technology to streamline and automate business processes.
Workflows in Salesforce lets you automate these processes to save time across your org. For this, some rules are set up as a set of instructions. Here, we will discuss the Salesforce workflow rules and how to use them.
What are Salesforce Workflow Rules?
Workflow is a Salesforce platform business logic engine that allows defining rules to automate certain actions when particular criteria are met. Workflows can be triggered by various events, such as the creation of a new record, the update of a specific field value, or a record reaching a certain stage in a process.
Salesforce workflow rules are automated processes that streamline actions within your Salesforce org based on pre-defined criteria. Imagine them as automated “if/then” statements that trigger specific actions when certain conditions are met.
Note:
Starting in the Winter of ’23, Salesforce recommends that we should not create Workflows. You can still activate, deactivate, and edit any existing workflow rules. To test and create workflow rules for use in managed packages, developer orgs still allow you to create workflow rules. For new automation, consider using flows.
Salesforce Workflow Rules Components
There are two components of workflow in Salesforce that are included in the container that workflow is:
- Criteria: It consists of the condition in which the actions should take place if found true.
- Actions: It consists of the actions that should be performed when the criteria for workflow rule are met.
Every Salesforce Workflow rule must be based on a single object because when a rule is defined, this object influences the fields that will be available to set the criteria.
Evaluation Criteria For Workflows
Criteria for rules can be represented as a condition or a formula. There are three types of evaluation criteria for workflows in Salesforce:
Evaluate the rule when a record is | Description |
Created | Runs the rule if the rule criteria are met, only when a record is created. Using this option the rule runs single time only. |
Created & Every time it is edited | Runs the rule if the criteria are met: Always when a record is created and meets the criteria.Only when a record not meeting the criteria is updated and now it meets the criteria. (As Explained in Class/Video) By default, these criteria are selected. |
Created and Every time it’s edited to subsequently meet the criteria | Runs the rule if the criteria are met: Always when a record is created and meets the criteria.Only when a record not meeting the criteria is updated and now it meet the criteria. (As Explained in Class/Video) By default, these criteria are selected. |
Actions in Salesforce Workflow Rules
Actions are simple the part of the then statement in the if/then condition. Workflow actions in Salesforce are of 2 types based on when they are executed:
- Immediate Actions: These actions are executed immediately when the criteria for a rule are met.
- Time-Triggered Actions: These actions execute at a specific time which is specified when creating this type of action. In these types of actions, when the date or time comes on which the action needs to be executed, it again verifies whether the record is still meeting the criteria or not. If yes, then it executes the respective action; otherwise, not.
Types of Actions Available in Workflow Rules
There are four actions specified in a Workflow Rule:
1. Email Alert
It sends automated emails using an email template. Salesforce provides functionality to create email templates that can be used to send emails. There are four types of Classic Email templates:
- Text: All users can create or change text email templates.
- HTML with Classic letterhead: Administrators and Users with “Edit HTML Templates” permission can create HTML email templates based on a letterhead
- Custom HTML: Administrators and users with “Edit HTML Templates” permission can create HTML email templates without using a letterhead.
- Visualforce: Administrators & Developers can create templates using Visualforce. Visualforce email templates allow for advanced merging with a recipient’s data, where the content of a template can contain information from multiple records.
Email templates are stored in folders. There are two folders already present in every Salesforce org.
The first one is a Unified public Email Template where emails are available to every user in the organization.
The second one is the My Email Templates folder, which stores the email templates that are used personally by a particular user.
2. Field Update
Field updates allow the user to automatically change a field value on the record that initially triggered the workflow rule. If “Re-evaluate Workflow Rules after Field Change” is enabled for a field update action then Salesforce re-evaluates all workflow rules on the object if the field update results in a change to the value of the field.
Only workflow rules that didn’t fire before are retriggered. Cross Object field updates are also available for changing the values of fields on a related master record. Still, it is not available when re-evaluation is checked.
3. Tasks
It simply assigns a task to a single user, owner, or role. We can also make sure that a notification email is sent to the assignee when a task is automatically assigned.
Tasks should be assigned to roles if they have only one user assigned to that role. If there is more than one user assigned to that role then the task automatically gets assigned to the owner of the workflow rule.
4. Outbound Message
An outbound message sends particular information to a designated endpoint, such as an external service. These types of messages can be listened to using SOAP API. All the above actions can be used as immediate actions as well as time-triggered actions.
Time-triggered actions that are already triggered are visible in Time Based Workflow Queues. Administrators can also set default workflow users. Default Workflow users are the users who will be visible when the user that triggered the rule is not active.
Things to Remember
- Time-trigger actions cannot be added to active workflows. To add a time trigger action, first deactivate the workflow rule, then add an action.
- Another time trigger cannot be added if there is already a time trigger action scheduled for that object and present in the time-based workflow queue.
- The action a workflow rule takes can also trigger the execution of another workflow rule.
How to Configure Workflow Rule Criteria?
By understanding Salesforce workflows and their capabilities, you can leverage them to automate repetitive tasks, improve data accuracy, and streamline various processes within your Salesforce organization. So, let’s see how you can configure workflow rule criteria., with a step-by-step guide.
Step 1: The left side of the screen will display a Menu once you log in. To discover Process Automation, scroll below. Locate and click on Workflow Rules under this section.
Step 2: As seen in the illustration below, click New Rule on the new screen to establish a new workflow rule:
Step 3: At this point, you must choose an object. Any object is available for selection from the drop-down menu. Select Lead as the object to practice.
Step 4: The Workflow Rule configuration is done in this stage. You must enter the following information in order to achieve this:
- Edit Rule: Enter Rule Name
- Evaluation Criteria: Choose the required Evaluation Criteria
- Rule Criteria: Select criteria that are met from the first drop-down menu. In the Field section, select the required field criteria. Explore the different Field Types according to your wish.
Then, hit Save & Next.
Step 5: A Workflow Action must be added in this step. Click on Do after choosing the desired action (in this case, New Email Alert) from the drop-down menu.
Step 6: You will establish an email alert in this step. You must complete the following details to do so:
- Description: This textbox needs to have the subject line of the email.
- Distinguished Name: This will automatically show up based on your description.
- Email Layout Example: An email template is a text template that will be included in emails. You have two options: either make your email template or select one of the pre-made ones. To accomplish this, click the magnifying symbol next to the textbox.
- Recipients: Decide who should receive which recipients.
After filling in all the details, click on Save.
Step 7: After that, select Done on the screen that appears to preserve your current work.
Step 8: At this point, click Activate to make the workflow rule active.
Step 9: Go to the App launcher and search for the object for which you want to create the record
Step 10: To create a Salesforce record, click New.
Step 11: The screen that follows will show up when you click on New. Enter the required information here, then select Save.
After saving, a screen showing the confirmation of data will be displayed
Also, a confirmation mail will be sent to you
Now, for the time-dependent workflow actions:
Step 12: In this step, you will try to add the Time Trigger. For that, go to your Workflow Rule page and click on Edit
After that, Deactivate the workflow rule and click on Edit
Now, click on Add Time Tigger
Step 13: Select the number of days, months, or years after which you want the action to be executed and click on Save
Now, the trigger has been created. You can add the preferred workflow action. Here, select New Email Alert
Step 14: Create the email alert as created before
Step 15: Click on Activate. Your workflow rule is created successfully!
That was all about the Salesforce workflow rules.
Next TopicNeed Extra Support? Our FREE study materials have got you covered.
Our expert-prepared study materials provide the answers you need. Clear your doubts and improve your skills with detailed notes from industry professionals.