Salesforce Flow Debugging


Salesforce flows are a powerful tool for automating business processes, but like any complex system, debugging them can be a challenge. In this blog post, we'll explore techniques for effectively debugging Salesforce flows using real-world examples. By mastering these techniques, you'll be better equipped to troubleshoot issues and ensure the smooth operation of your automation processes.

Enabling Debugging Mode:

Before diving into specific debugging techniques, it's important to enable debugging mode in Salesforce Setup. This allows you to generate detailed debug logs that capture the execution of your flows. To enable debugging mode, navigate to Setup > Debug Logs and set up monitoring for the appropriate user or users involved in flow execution.

Using Debug Logs:

Debug logs are a critical tool for understanding flow execution and identifying issues. When a flow runs, Salesforce generates a debug log that provides a detailed record of the flow's execution, including flow element execution order, variable values, and any errors encountered. By reviewing debug logs, you can gain insights into what's happening behind the scenes and pinpoint areas for improvement.

Debugging Techniques:

Now let's explore some specific techniques for debugging Salesforce flows:

A. Debugging on Canvas

Canvas debugging is a popular method among Salesforce professionals. It provides a hands-on approach, allowing users to interact directly with the Flow Builder interface to identify and resolve issues. Here is the step-by-step process:

1. Accessing the Debug Mode: Once you’ve designed a flow you’ll notice a ‘Debug’ button at the canvas’s top. Clicking on this button initiates the debugging process.

Canvas Debug button

Figure 1: Debug button at Flow Builder Canvas.

2. Setting the Entry Criteria: Before running the flow in debug mode, you need to specify certain entry criteria. This could be a Salesforce Record ID or any specific data that might initiate an action within the flow.Click Run.

input variables

Figure 2: Set the debug options and input variables

3. Monitoring the Flow’s Progress: After setting the entry criteria, you can run the flow. As it progresses, you’ll receive the debug details for the run appear in a panel on the right.

Debug details

Figure 3: Debug details appear on the right side of the screen.

4. To restart the flow using the same or different values for the input variables, click Debug Again.

5. To convert the debug run to a test, click Convert to Test.

Debug details

Figure 3: Debug details appear on the right side of the screen.

B. Debugging Salesforce Flows via Email Notifications

By default, Salesforce sends an email to the last person who edited the flow when an error occurs. This ensures immediate attention to the issue.The email contains a direct link to the Flow Builder canvas.

Email sent by salesforce flow

Figure 4: Email sent by salesforce flow when there is error in flow with error details and open link.

Example Debugging Scenario:

Let's consider a scenario where a Salesforce flow is used to automate lead conversion. During testing, some leads meeting the conversion criteria are not being converted properly. By enabling debugging mode and reviewing debug logs, we can identify the root cause of the issue and make necessary adjustments to the flow logic to ensure all leads are converted successfully.

Debug details of Lead conversion flow

Figure 5: Debug details of Lead conversion flow.


Debugging Salesforce flows may seem daunting at first, but with the right techniques and tools at your disposal, you can effectively troubleshoot issues and optimize the performance of your automation processes. By mastering the techniques outlined in this blog post and applying them to real-world scenarios, you'll be better equipped to harness the full power of Salesforce flows and drive business success.

Start debugging with confidence today and unlock the full potential of your Salesforce automation efforts!

For any queries please reach out to