[SalesForce] Deployment error caused by Process Builder flow

Can anyone help please? I get the below error when trying to deploy some changes to live and it appears that one of our flows that we recently built using process builder is causing the problem but I cannot understand the error and don't know what the fix is. Does anyone have any ideas on how to resolve this please?

Thanks in advance for your help:

ERROR:

first error: UNKNOWN_EXCEPTION, The record couldn’t be saved because it failed to trigger a flow.
java.lang.IllegalArgumentException: unable to find field dataType for complex reference
unable to find field dataType for complex reference
Contact your administrator for help.: []

Best Answer

Try something like this:

Create a checkbox field like Bypass_Flow__c on Contact, opportunity and the objects which your flow is using

On your test class which is failing add this on contact,Opportunity and all objects for which test data is created.

Bypass_Flow__c = true;

Now on the Process Builder add this condition:

enter image description here