Salesforce's error messages are not always very clear. One of the most notorious ones is the following:
CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow.
A flow trigger failed to execute the flow with version ID XXXXXXXXXXXXXXX.
Have you ever gotten this before? If you have, then you probably realized that this had something to do with a workflow or process flow - but which one? If you try to navigate to the version ID by placing it in the URL, you'll be given an "insufficient permission" error:
Really useful. So how do we fix the error if we don't even know which flow is causing the problem?
Fortuantely for us, Workbench gives us a very nice way to figure out which flow the verison ID refers to. If you're not familiar with Workbench, it is a web-based tool suite to provide both information about and interactivity with your Salesforce organization. It's also free to use.
Here's how to use Workbench to identify the flow:
- First thing you'll have to do is log into workbench. Select the right environment (Production or Sandbox) and click the Login button. Note that if you're trying to troubleshoot a developer box, that falls under "Production".
- After you've logged in you'll see the standard workbench frontpage and menu. You'll want to click the "Info" tab in the menu, and then choose "Metadata Types and Components"
- The Metadata Types and Components section will allow you to view info about all metadata of different types in your org. This includes flows. In the dropdown, select "Flows".
- Two folders will appear. Click "Expand All" to open both of them up. This will list out all the details about each Flow.
- Now it's as simple as doing a Ctrl + F to find the ID you're looking for. Once you've found the ID, you'll have the flow name, and you can start troubleshooting from there.
This is only one of the many things that Workbench can do. It's useful, so bookmark it!