Last Updated on April 3, 2022 by Rakesh Gupta
Salesforce Flow is one of the most powerful tools provided by Salesforce to implement business requirements declaratively. Salesforce Flow helps businesses to save time, as well as money, by implementing solutions quickly. In theory, implementation of Salesforce Flow is straightforward – you create a Flow; test it; and then, use Change Set to deploy it to Production. Seems simple, right? But, not so fast!
Just like most things in life, however, Salesforce Flow is not immune to bugs :(; and, neither is it any easier to debug it :(. Salesforce, however, does offer a handful of debugging tools – such as a user can use Error Email sent by Salesforce; or, a user can leverage standard Debug Log. Each option, however, has its pros and cons. This article is focused on (1) What is a Flow and Process Error Email and, how does it work?; and, (2) How to control who receives Flow and Process Error Emails.
By default, when a Process or Flow interview (Running version of a Flow) fails, Salesforce sends a detailed Error email to the admin who last modified the Process or Flow, as shown in the following screenshot:
The email includes (1) an error message from the failure; and, (2) details about how each flow element, in the interview, was executed. In most cases, these emails are very helpful in solving the problem. In the preceding screenshot, the error message stated that the error occurred due to a particular Validation Rule. And, therefore, by default, the error email went to an admin that last modified the Process or Flow.
Business Use Case
Edward Backhouse is working as a System administrator at GurukulOnCloud. He has created many Processes to streamline the sales and services lifecycle at GurukulOnCloud. As he created all Processes and Flows, by default, he receives all error emails for Flows and Processes. Last week, Edward onboarded a new Salesforce Administrator Annie Ingersoll. Now, Edward is looking for a way to channel error emails to Annie Ingersoll for all the Flows and Processes that he created.
A solution for the above business requirement
There are a few possible solutions for the above business scenario – for instance, Edward Backhouse can create a Rule on his mail client to forward these types of emails either to Annie Ingersoll or someone else. This solution may work as long as Edward Backhouse is with the Organization. But, what happens when Edward Backhouse leaves the organization? As a Super Admin, you must put in place safeguards to ensure that the system remains functional under varied circumstances! So, now, let us think through this again – What happens when Edward Backhouse leaves the organization? How are you going to make sure that despite changes in staff, or other unforeseen circumstances, the system continues to function as expected?
You can send Flow and Process error emails to the Apex exception email recipients that you specify in Setup.
- To change where Flow and Process error emails are sent, navigate to Setup (Gear Icon) | Setup | Process Automation | Process Automation Settings
- Then locate the field Send Process or Flow Error Email to, update it to Apex Exception Email Recipients.
- Once done, click on the Save button.
- The next step is to specify users and email addresses as Apex exception email recipients. Navigate to Setup (Gear Icon) | Setup | Email | Apex Exception Email
- Click on the Add Salesforce User button to add a Salesforce user.
- It is also possible to include an email address that doesn’t belong to any user. For example, you may want to forward these emails to your IT team.
Wasn’t that a great journey? Now you know how to control who receives Flow And Process Error Emails!
Yes, go ahead! Show off your newly acquired skills to your friends, colleagues, and families!
Please feel free to add constructive comments, insights – and yes, challenges too! – to the blog. Good Luck in your Journey towards becoming a Salesforce Ninja!
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.