We have the following:
- an record-triggered after-save flow on Opp, which depending on circumstances may do several DMLs, including an update to the triggering opp.
- a PB op Opp which calls a separate autolaunched flow that sends an email
One of the updates that #1 does to the triggering opp is a field change that would cause the opp to meet the conditions for #2. So what we'd expect is for both of them to run.
However, the behavior we're seeing is that when #1 runs, #2 does not run. It's not that the #2 PB is firing and not meeting the conditions. Based on debug logs, it's not firing at all. And we don't understand why.
We know about the recursion prevention features outlined here https://architect.salesforce.com/design/decision-guides/trigger-automation/ but those wouldn't seem to apply here. The key sentence seems to be this:
If that trigger has already previously fired in response to a previous DML operation ... and in doing so set off a chain of DML operations that has led to the current DML ... The trigger doesn't fire.
In our case the PB in #2 is firing before the flow in #1. But it's not meeting its conditions (since flow #1 hasn't set that field yet) so it does nothing. So while the PB in #2 "previously fired" it didn't "set off a chain of DML operations...". Am I misunderstanding this?
If not, can anyone think of other reasons why #2 would not be firing after #1 does its update?
BTW, we do understand that in most cases it's better to handle field updates on the triggering record in a before-save flow or trigger. But in this case the #1 flow is updating additional records, not just the triggering opp.
TIA for your help!
EDIT: we got this working already by changing how these flows are triggered. But we would still like to understand why it was behaving the way it was originally.