[SalesForce] Approval Process Error: Too many retries of batch save in the presence of Apex triggers with failures: Number of retries: 2

I have an Process Builder process that submits a records into a Approval Process. It only seems to work without error if I have no entry criteria. If I have any criteria added to the Process Builder besides "No Criteria-just execute action!" (and I've changed this to several different criteria that could be applicable to the approval process)
I am given a workflow failed to trigger a flow error and the debug logs show:

An error occurred at element myRule_1_A1.
Too many retries of batch save in the presence of Apex triggers with failures: when triggers are present partial save requires that some subset of rows save without any errors in order to avoid inconsistent side effects from those triggers. Number of retries: 2 .

Flow Details
Flow Name: Approval_Process_Training_Request
Type: Workflow
Version: 11
Status: ACTIVE

Flow Details
Start time(GMT): Wed Jul 15 15:51:35 GMT 2015
End time(GMT): Not Yet Finished
Duration: 2 seconds
Decision: myDecision
Submit for Approval: myRule_1_A1

Has anyone seen this error and how did you workaround it? Thank you in advance,

Best Answer

I had similar error "Too many retries of batch save in the presence of Apex triggers with failures: when triggers are present partial save requires that some subset of rows save without any errors in order to avoid inconsistent side effects from those triggers" when I try to fix the unit test after changes 2-step approval process into 5-step approval process.

Yesterday after deep investigation I have discovered that this error happens when you have another error in trigger, workflow, process builder or visual flow, any of which is triggered by approval process.

In my case trigger caused 101 SOQL DML Exception. So when I moved 4 approval process steps before Test.startTest statement and 1 approval process step after Test.startTest statement, the inner error has fixed and so the outer error disappeared.

Related Topic