What is a workflow rule?
A workflow rule will automatically take action when a record meets specified criteria.
You could create a workflow rule to email the strategic accounts team public group when an opportunity is greater than 100,000 USD.
What is an approval process?
An approval process takes action on a record based on user feedback. Whereas a workflow rule automatically takes action based on record criteria, an approval process is manually initiated by the user.
The administrator configures the approval process, determining conditions that the record must meet in order to be submitted for approval, who must approve the record, and what actions take place as a result of approval, recall, or rejection.
All opportunities with a discount greater than 10% must be approved by the account executive’s manager prior to shipping. All opportunities with a discount greater than 15% must be approved by the VP of Sales prior to quote approval.
What actions can workflow rules and approval processes perform?
Workflow rules and approval processes reference the same bank of actions, and can perform the following:
- Create a task record
- Send an email
- Update a field
- Send an outbound message (used for integrations)
Workflow rules execute when the evaluation and rule criteria are both met.
One of 3 evaluation criteria can be selected:
The workflow rule will only fire if it meets the rule criteria when the record is created.
2. created, and every time it’s edited
The workflow rule will fire any time a record is saved and meets the rule criteria.
* Cannot be used in conjunction with time-based workflow actions.
3. created, and any time it’s edited to subsequently meet criteria
When this option is selected, the workflow rule will only fire the first time that the record meets the specified criteria. On subsequent edits, if the record continues to meet the criteria, it will not trigger the rule again.
However, if the record is modified to no longer meet the rule criteria, then edited once again and does meet the rule criteria, it will fire again.
A workflow rule has been created that emails the VP of Sales when an opportunity is Closed/Lost; the rule is set to execute every time a record is “created, and any time it’s edited to subsequently meet criteria”.
Bill is a sales rep working a deal. After a long negotiation with a prospect, Bill ultimately loses the deal. He marks the deal as Closed/Lost, and the workflow rule sends an email to the VP of sales. The VP requests that Bill add additional information to the opportunity about why they lost the deal.
Bill updates the opportunity (which is already closed/lost); this subsequent update does not trigger another email to the VP of sales. However, if the workflow rule were set to “created, and every time it’s edited”, this update would trigger another email alert.
The prospect calls Bill and asks him to resubmit his proposal as their other vendor fell through. Bill updates the opportunity stage to “Contract Negotiation”. Ultimately, Bill once again loses the deal.
He once again updates the stage to “Closed/Lost” – this update does trigger a second workflow notification to the VP of sales.
The reason that this update triggers an email notification is that it did not meet the workflow criteria prior to the update (as the stage was “Contract Negotiation”). Thus “any time it’s edited to subsequently meet criteria” effectively means “any time it’s edited and did not previously meet workflow criteria”.
The rule criteria can either be determined by specified field values or via formula evaluation:
Time-Dependent Workflow Actions
Time-dependent workflow actions are scheduled to execute at a specified time after the workflow rule itself has triggered.
I want to send a notification to the opportunity owner to follow up with the client 30 days after an opportunity is marked Closed/Won. The criteria for workflow execution is the condition “Won = TRUE” – however – the execution of the action (sending the email) must take place 30 days after that condition is met.
Time-based workflow actions are structured as follows:
Workflow rule –> Time Trigger –> Workflow Action
When the workflow rule executes, the workflow actions within the specified time trigger will fire accordingly.
If the record is edited and no longer meets the workflow criteria, pending workflow actions are unscheduled.
Limitations and considerations:
- Modifying an active time-based workflow rule can be tricky. Deactivating the workflow rule does not remove pending time-based actions that the workflow rule previously scheduled for future execution.
- Likewise, adding workflow actions to an active time-based workflow rule will not retroactively schedule the new actions on records where existing actions are pending.
- Time triggers cannot be added to an active time-based workflow rule.
Approval Process Structure
Each approval process is comprised of the following:
- Entry Criteria – the record must meet this criteria in order to be submitted for approval.
- Initial Submissions Actions – these actions are taken once any record is submitted for approval.
- Approval Steps – each approval step has its own entry criteria, approval actions, and rejection actions.
- Final Approval Actions – these actions are taken once all users (within all approval steps) have granted approval.
- Final Rejection Actions – these actions are taken once any user rejects the approval.
- Recall Actions – these actions are taken when the approval is recalled (assuming that approval process allows approval recall).
Enhancing Approval Reporting
Note that there is no out of the box way to report on approval status or age. Therefore I often add one or both of the following to approval processes:
1. Approval Status field
Picklist field with values:
You’ll need to add the custom field, and field updates to each corresponding section of the approval process:
2. Approval Submission Date
Date/time field, updated to “NOW()” via approval action within initial submission actions:
Approval age can be added via formula once you have the date captured, as shown above.
Just a heads up for everyone. The SF docs are wrong when it comes to the limitations on using time-based actions with certain eval criteria settings. https://help.salesforce.com/articleView?id=workflow_time_dependent.htm&type=5
What John has listed above is correct.
Is there a way to “undo” a workflow without using the AppExchange? E.g. A workflow may automatically create Opps when a Lead is created. But say you are doing a data import and you insert 1000 records and forget to turn off the workflow, is there a way to undo the damage? Because if you delete all the Leads, surely the Opps would remain…?
Workflow can’t create a record (except tasks/events), but the short answer is no there is no undo
With the Approval Process example image on this article, Step 1 has an entry criteria of Discount >= 0.1 and step 2 has Discount >= 0.15. I’m wondering though if the discount is, say 0.2, it will still trigger step 1 won’t it? And then will it process the approval for the “> 10%” discount, without triggering then the “> 15%” approval step? Should the order of these be reversed? That is, step 1 = “> 15%” and if not step 2 is “> 10%”?
I’m sure I’m missing something in the concepts here, just not sure what.
Step 1: If > 10% discount, require approval from manager
Step 2: If > 15% discount, require approval from james smith
If you wanted to reverse the order you could. The approval is sequential – so James won’t get the approval until the manager has approved the discount.
A 20% discount would enter both steps- if you wanted to exclude step 1, then you would have two conditions: a) > 10% discount, b) < 15% discount. Hope that helps!
Thanks John and Tejalr! – I guess this link explains the limitations of time trigger – https://help.salesforce.com/apex/HTViewHelpDoc?id=workflow_time_action_considerations.htm&language=en
In my scenario I have created a time based workflow action which would send an email to owner of an opportunity based on a criteria. The workflow action send email after 15 days. Many of my records were created or update which met the criteria in workflow rule and whose owner are scheduled to receive an email after 15 days. Since this workflow was created very recently, I would like to change 15 days to 10 days in my workflow action. If I change that would the existing record which are untouched, will there owner get the email after 10 days or 15 days?
The workflow rule will trigger when record is created or edited only. I guess logically the record which were edited or created when 15 days rule was active , will get email after 15 days only. If I change the rule to 10 days and hit edit/save on the record which meets the criteria, will the owner now get an email with in 10 days?
For that chk out ur workflow log (monitor time trigger)you can see which workflow r already in queue . On that you can see what are the workflow results will exist or not.if it’s already in queue and you change your workflow or deactivate I think , but if it’s not in queue you can make changes and it will work accordingly. Hope I m not wrong still I would love to hear from John .
I believe when you deactivate the workflow rule (which is required to make this change), it will remove any pending actions associated with the rule (you can check workflow queue – good suggestion tejalr).
[edit: the actions are only deactivated if the record is modified again]
In the details above.. its mentioned “Modifying an active time-based workflow rule can be tricky. Deactivating the workflow rule does not remove pending time-based actions that the workflow rule previously scheduled for future execution.”
Here in the comments you are saying otherwise..
Can you please clarify ?
I have this question too? It was an exam question and wasn’t sure what to put b/c of this comment.
When the workflow rule is deactivated, the pending actions will remain as scheduled prior to workflow being deactivated. If a record with a pending action is modified (and the workflow is still inactive), then the pending action will be removed (as it no longer meets the entry criteria for the workflow… b/c the rule isnt active).
So if you are looking to change the time trigger, you will need to deactivate update all of the records again to trigger the workflow timer.
Also this is why it is often a good idea to use a custom field to set the execution time rather than a timer (easier to update a field than to change the workflow itself).
Can you let me know what does this line means – Time triggers cannot be added to an active time-based workflow rule.?
That does mean , to add time trigger on any existing workflow, you first need to deactivate it(if it’s already in active mode) otherwise you can not add any add on time trigger if the work flow or also for more then one time trigger to work with existing workflow.you can try adding time trigger on any existing workflow and you can see this same behavior.
Here is a beautiful example to really have visual understanding for approval and the process.
I was bit confuse with the image for approval steps for discount example you gave …
but found this video and got the same idea with solving my confusion.
I hope you like to add in here.
thank you .
This video is listed in the main section content
Thanks for sharing that video tejair- was very helpful.
i made a mistake whilst do a workflow rule in my org but i made a mistake and then deleted the rule.
But i could not create another workflow rule using the same name is this what happens, or do i have to wait for a certain number of hours.
I have seen that happen before, where it takes a few minutes/hours for the deletion to complete.
I messed up on one of the quiz questions 🙁 So, have been trying to dig into understanding approval process a bit more. Found some nice info; below is the link.
Awesome thanks for the link!
Thanks for sharing this , i suggest including this link in that section if possible
Found a very nice, and short, youtube video on Approval and Workflow process. https://www.youtube.com/watch?v=hilJXtRJcEU
This one is listed in the workflow section
Can anyone please answer this question,
Workflow approvals can be done from: (Select all that applies)
A. In Chatter
B. From record
C. From email
D. From home page
Pretty sure the answer is all of the above – I haven’t used approval from Chatter but I remember that feature being added. From the record, email, and home page are all definitely true. Haven’t issued an approval from mobile but fairly sure you can there as well.
Even I thought the same. But, in one of the quizlet’s flashcard it said “A,B,D,E”(Email was included), so I wanted to confirm it.
Thanks a lot John. For replying so quickly and developing such a wonderful guide. Thank You. 🙂
— (Email was ‘not’ included) —
I just approved a request via email yesterday. Most definitely possible, and has been for ages 🙂
chatter,email and home page.
and also mobile Salesforce1 app.
If a record is submitted for approval and the approver does not have read access to the record, then the submitter would need to manually share the record to the approver, right?
Is Read only rights enough or he needs Read / Write?
That’s a good question – according to the documentation the permission vary based on the approval process, but that doesn’t precisely answer the question: https://help.salesforce.com/HTViewHelpDoc?id=approvals_considerations.htm&language=en_US
I suspect you need read access to approve the record, and possibly read/write to issue a field update… but unfortunately I don’t have a clear answer at this stage. When I get a moment, I will test this out and see what I can find out.
Under “What actions can workflow rules and approval processes perform?”, should Flow Trigger be used here? It says that it is on the other document you send us to – just want to be sure.
Also, is Visual Workflow included on the Admin 201 Exam?
Actually – it looks like it’s a pilot-only program right now, so it’s doubtful it will be on the 201 Exam.
What’s is in pilot? Visual workflow engine (flow) has been around for a while and is covered lightly in the guide. There shouldn’t be many questions on the exam about it.
Is this now called Lightening?
No, lightning is different
There are a few different capabilities:
Lightning Process Builder
This page currently discusses the first two, but the second two are addressed in the workflow main section of the guide.
“there is no out of the box way to report on approval status or age.” —> strange, isn’t it? I hope that this becomes a standard feature in a future Salesforce release
Me too… although a friend of mine developed an AppExchange package to do just that 🙂
Thanks, not sure how I missed that. Updated.
“determining conditions that must the record must meet in order to be submitted for approval”
2 x must in the same sentence.
Hey Frank – I didn’t catch this – which sentence?