Process Builder and Flow bulkification

Process Builder and Flow are so easy to use that even non-developers can „develop“ quite complex processes. It has its consequences, for example the processing time might be longer.

Also it wasn’t correctly bulkified before, but as of Winter ’16 it should be fully bulkified. Still, there are most likely some critical updates waiting for activation in your instance – „Enable Partial Save for Create and Update Operations in Processes“ and „Execute All Flow Interviews When Invoked in Bulk„.

And just lately I had some complex process and I run into the mighty „System.LimitException: Too many SOQL queries: 101“ which I had to solve and at the time decided to test how it works.

What I wanted to test:

  1. Process Builder which updates the same record which started it, when updating bulk of records;
  2. Process Builder which updates child records, invoking in bulk;
  3. Flow started from Process Builder, which update records;
  4. Flow started from Process Builder, which lookup and update records;
  5. Flow started from Process Builder with Fast Lookup and updating records in a loop;
  6. Enabling the critical updates and test for changes.

Results

I was pleasantly surprised, as everything worked except #5. I tested it with 300 records and the only problem was going through records in a loop and updating them one by one. Quite obvious and problematic for non-developers at the same time, as you need to save the records into a collection and update the whole collection at once.

Second surprise was, that even activating the „Enable Partial Save for Create and Update Operations in Processes“ critical update there was no change. It still failed (obviously) and no update to even first 100 records was made.  Strange.

All solved

I’m quite happy with the results. Don’t understand what those critical updates are, but as everything works well without them, I’m just happy. 

There is still reason to write triggers for better performance, but in smaller instances the combination of process builder and flow is just ok.

Zajímá mě tvůj názor