Recursive Behaviour? Scheduled Paths possibly causing an issue
Big note first - Huge fan of the apex rollup helper, and use it extensively in our business. Currently drawing a blank here around the behaviour we're seeing, and whether it is inadvertently a bug or some other underlying issue.
Process:
- We have scheduled apex as part of a managed package that mass updates a field daily.
- Updating this field triggers a separate flow that attempts to locate a "matching" record using apex invocables from another managed package. Due to restrictions of this managed package and how they've created their apex actions, we've had to execute the flow with a scheduled path, kicking the process off 1 minute later (this may be relevant)
- If a match is found, and the lookup is populated on a Lead record to an Account, and this change kicks off a separate flow that will execute the apex rollup, to count the "open leads" linked to an Account.
We are currently hitting our async apex limits for a day after executing the above process for 1 record, and all we can see after debugging and our apex jobs, is they're getting flooded with the RollupFullBatchRecalculator, it just keeps firing over and over again. Now we know for a fact that the flow that executes the rollup wouldn't re-fire (it specifically looks at whether account has changed, or other fields that aren't updated in the process) so this should just execute the one time. In our testing, we do admittedly have 600 open Leads linked to the Account already, when we attempt to fire the process for the 1 Lead, but that wouldn't explain how we can end up hitting our 250k daily limit (albeit gradually).
It's also worth noting that we do use the rollup helper for other fields that are heavily updated on a daily basis in Production (Pardot engagement score for example) and we are nowhere near hitting our daily async apex limit. The only difference I can think of is the flow trigger in question, is executed after a scheduled job, but again, I'm grasping at straws.
We're currently trying to set up the process by rolling up the old fashioned way (which is working fine), so the whole thing just feels off, but thought I'd highlight it here in case there is something weird happening off the back of a scheduled path in one flow, that subsequently triggers the other process to rollup. We did try to change the rollup to run sync but looks like our apex jobs still got flooded regardless.
We'll be carrying out some more tests, but would love to hear if we have somehow screwed something up, as the flow firing itself definitely shouldn't be the case!
Thanks for the details, I will take a look!
@simoneduckworth I made some change to the way that full recalculations chain over the past few versions - is this issue still happening?