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
Michael Venman 3Michael Venman 3 

Help to Bulkify a Process Builder activated Flow

I'm getting the "Too many SOQL queries: 101" error when I try to insert more than 15 records at a time based on a flow I've used to create a sales cycle object to record and track the appropriate call volume each time a lead is worked.  This object needs to be created every time a lead is put into a user's name and a lead doesn't exist.

I've looked up the information about bulkifying a flow and can't seem to find my answer.  I don't have any flows, and my understanding is that it should take these 100 leads I'm updating/inserting and bulk them into 1 SOQL query automatically.  Am I missing something?  Do I need to create an SObject or do a Fast Lookup or Fast Create to trigger the bulkification process?  Right now, every time the lead qualifies it fires a separate interview for each record, so I don't believe that is the right way to go.

Any help would be greatly appreciated!

NOTE - I posted this on the usual help forum, and was directed here to receieve more targed advice.  THANK YOU!

Visual Flow layout
Gaurav HandooGaurav Handoo
Hi Micheal

As per the Screenshot attached, you are already running 3 SOQLs for a single record that meets the critieria of your time based flow. Based on your problem statement, I would be assuming that you already have some SOQL events happening through Process Builder as well.

Recommendation here would be:
  1. Move the update lead element out of flow and into Process Builder itself (if it is updating the lead with same values in both the outcomes of decision box).
  2. Change the Record update to Fast Update and use Sobject collection to update the same.


Hope this helps. Please mark as best answer if it does.

Cheers!!

Gaurav