function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rebecca RallsRebecca Ralls 

Too Many SOQL QUEries Error from Process Builder Flow

Hi there,

Conversation started here: https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001rzc&fId=0D53A00003fsbOX&s1oid=00D300000000iTz&OpenCommentForEdit=1&s1nid=0DB30000000072L&emkind=chatterCommentNotification&s1uid=0053000000A6wMv&emtm=1529343276536&fromEmail=1&s1ext=0

I am receiving a Too Many SOQL queries error from a process builder flow when I create > 100 Records at a time.  I thought Process builder was finally supposed to be properly bulkified as of Summer '18?

Here is my process. 

Owner update flow

It is REALLY straightforward.  It reassigns the owner on a record to match the owner of a record specified by a lookup field.  The field is "Entity" the process checks to make sure that the entity field has a value, and checks to see if the owner on the record maches the owner of the entity record.  If not, it updates the recor owner to match. It works perfectly as long as I only fire <100 records at a time.  But when I fire more records than that it fails. There is a slight possible catch in that the thing that "fires" (creates) the records on this object is a trigger from a managed package. The records on this object cannot be created manually, so I cannot test it,bBut I imagine it would be much the same if I uploaded too many records via dataloader.

I saw that this was a known issue here: https://success.salesforce.com/ideaView?id=08730000000DhBlAAK - but is says it was delivered in Winter '16.

Do i need to bite the bullet and create a trigger instead?

Any help or insight would be much appreciated. 
Thanks!
 
Best Answer chosen by Rebecca Ralls
Rebecca RallsRebecca Ralls
Apparently there is a "Bulkify" permission that Salesforce can enable.  Why it is not enabled by default is a COMPLETE mystery to me, but it a very exciting turn of events, it actually seems to work! 

So - a note to anyone else experiencing too many SOQL queries error in PB - contact Salesforce.  ask them to enable the Bulkify permission in your org.  To submit a case go to Setup & Security -> Workflow Automation (Not Development -> Flow) and tell them you're receiving the Too many SOQL Queries error on PB.  

All Answers

Waqar Hussain SFWaqar Hussain SF
I faced the same issue in Process builder. I did not find any solution for this. I think Process builders are not bulkified.

Finaly I converted process builder to apex trigger which worked really well. 

Try converting process builder to apex trigger.
Rebecca RallsRebecca Ralls
Apparently there is a "Bulkify" permission that Salesforce can enable.  Why it is not enabled by default is a COMPLETE mystery to me, but it a very exciting turn of events, it actually seems to work! 

So - a note to anyone else experiencing too many SOQL queries error in PB - contact Salesforce.  ask them to enable the Bulkify permission in your org.  To submit a case go to Setup & Security -> Workflow Automation (Not Development -> Flow) and tell them you're receiving the Too many SOQL Queries error on PB.  
This was selected as the best answer
Waqar Hussain SFWaqar Hussain SF
Thank you Rebecca for sharing the information.