Monday 16 January 2017

Ways to identify your failed flow/process builder


We would have seen this error while trying to save a record in our Salesforce instance. The information provided is very generic and little; it shows just the flow version id. It would have been strange for the people seeing this for the first time. I too had come across such situation and this is an effort to spreading the information out there.
The record couldn’t be saved because it failed to trigger a flow. 
A flow trigger failed to execute the flow with version ID 3013B000000DBl4. 
Flow error messages: 
An unhandled fault has occurred in this flow

An unhandled fault has occurred while processing the flow. 
Please contact your system administrator for more information. 
Contact your administrator for help.


This post aims at outlining a few ways to identify which component is causing this error.
Option #1: Look into your debug log
Keep your developer console opened and try to save your record again. Search for the logs like below. You can get the flow/process builder name under "Error executing flow".
00:49:57.0 (80251134)|WF_FLOW_ACTION_ERROR|09L3B000000ChpG|3003B000000CgBk|
Error executing flow: Create_and_Update_Opportunity_for_Provisioning_Order, 
FlowDefId: 3003B000000CgBk, FlowVersionId: 3013B000000DBl4

00:49:57.0 (80266593)|WF_FLOW_ACTION_ERROR_DETAIL|<b>An unhandled fault has occurred in this flow</b>

An unhandled fault has occurred while processing the flow. 
Please contact your system administrator for more information.

00:49:57.0 (80340575)|WF_FLOW_ACTION_END|09L3B000000ChpG
Option #2: Use Workbench REST explorer to get the details
Go to Workbench --> Utilities --> REST Explorer and use GET with the below path to get the information: (/services/data/v37.0/tooling/sobjects/flow/{flowID})
For example; see the screen shot

Option #3: URL hacking
https://[instance].salesforce.com/designer/designer.apexp#Id=[id]
Replace [id] with the flow ID that is errored out and [instance] with your salesforce instance


Processes and Flows seems to have the same underlying technology, and this option will pull up either one in the Flow editor. This will help you to get the name of the component(flow/process builder). Note to edit Flow in Flow Designer and edit Processes in Process Builder only to avoid any confusion or unintended results. This is how you identify if it is a flow or process: Close the designer page and if you lands on process builder page, go to the process you noted down. If you are on the flow page, click to open the flow again.
Option #4: Search by Id under metadata type in Workbench
Go to Workbench --> info --> Metadata Types & Components --< Choose "Flow" from the picklist --> click Expand All --> CTRL+F to find the Flow name and details by its Id.

You can find both flows and processes using Workbench:
Info --> Metadata Types & Components --> Flow for Flows 

Info --> Metadata Types & Components --> FlowDefinition for Processes