-
I have a simple scheduled flow that runs that updates a collection of records. It is a very simple flow just updates one field on each of the records in the collection. It has previously worked without any issue. These records are the child object in an Apex Rollup. Now that I've introduced the flow trigger on the child object, it has pushed the transaction time beyond the APEX CPU limit. I've tried to create the apex rollup flow trigger as asynchronous but it appears that it is not possible. Do you have any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@baobao917 typically when I get reports like this, it's the result of other processing (either via Flow or Apex) on the records being updated. I'm happy to do some analysis for you if you have a log created from the schedule run of this flow |
Beta Was this translation helpful? Give feedback.
-
@jamessimone I'm not sure exactly what to send you. I ran a debug and it returned 12 pages of individual log records. As you can see from page 1 below, a scheduled job kicked off Scheduled Flow logThen common.api.soap.DirectSoap which I believe is ApexRollup logs created for the remaining 12 pages. Sample of last log.Here are the 2 email errors returned stating both failed due to CPU limitsSandbox_ An error occurred with your Billing - SCH - Update Prop Billing number from Stripe Invoice flow.txtSandbox_ An error occurred with your Billing - AS - CU - Trigger Apex Rollup flow.txt My guess is that when my scheduled flow runs, the default batch size is 200 which processes at under the apex CPU limit. But as soon as I added on the ApexRollup flow trigger on the same child object, that additional logic caused it to exceed that limit. Any suggestions? Pls let me know if you need anything else. |
Beta Was this translation helpful? Give feedback.
-
@jamessimone No worries. I am guessing that when performing a batch update of a collection of records, the inclusion of the ApexRollup flow trigger to fire upon each record update causes the overall transaction cpu limit to be exceeded. I performed a test where I just did a simple update operation (no field changes) on a batch of records. Any batch count > 70 caused it to fail with the apex cpu limit failures. So I'm definitely open to any workarounds or amendments you suggest for the long-term. In the meantime so that it didn't impact my current process, for the specific scheduled flow job that I have running (which just updates a field), I updated my ApexRollup flow trigger entry criteria to simply ignore those records (where that field ISCHANGED) for the time being. And hopefully they'll get picked up in the future. |
Beta Was this translation helpful? Give feedback.
Have created issue #539 since am experiencing this issue pretty consistently anytime a batch of records is updated.