[SalesForce] Process Builder Error with Bulk API

I set up a process to update the owner of a custom object (Program),

When Formula evaluates to true: [Program__c].OwnerId <>[Program__c].Franchise__c.OwnerId
Allow process to evaluate a record multiple times in a single transaction? NO
Do you want to execute the actions only when specified changes are made to the record? NO

Immediate Action: for Object Program__c
Set Object Variable:
Field: Owner ID
Value: Program__c.Account__r.OwnerId

The Process works when Programs are updated through Salesforce, but when a Bulk API process ran I received this error message:

Encountered unhandled fault when running process
Program_Owner_Update/301F000000006kW exception by user/organization:
00DA0000000IbPA/{4}

UPSERT — UPSERT FAILED — ERRORS :
(ALL_OR_NONE_OPERATION_ROLLED_BACK) Record rolled back because not all
records were valid and the request was using AllOrNone header — for
SFDC record with ID :,

caused by element : FlowRecordUpdate.myRule_1_A1

caused by: UPSERT — UPSERT FAILED — ERRORS :
(ALL_OR_NONE_OPERATION_ROLLED_BACK) Record rolled back because not all
records were valid and the request was using AllOrNone header — for
SFDC record with ID : ,

Salesforce Error ID: 572482331-21762 (-569115646)

Can the process builder be used with Bulk API updates?

Best Answer

So it appears that if Process Builder fails on any record, it currently causes the entire batch to rollback.

The official workaround from Salesforce is to set the batch size to 1. The claim this will only cause a minimal impact to sync times... I beg to differ.

In my cases I was getting Unable to Lock Row exceptions because the Flow was updating related records (and two flows tried to update the same one). Turning off parrellel processing can help this, but no guaranteed you won't run into Row Lock issues due to users.

Related Topic