I've been testing this in a trailhead org to confirm/test behavior within Process Builder. This means there's no other automation/code/trigger on the object I'm testing on.
Is it possible to have one action update a field that would trigger a scheduled action within the same process builder on creation of a record?
It seems if I do the following on create/update of a record:
- criteria node: always set a string for a specific field
- criteria node: if specific field is not null, post to chatter immediately and have a separate scheduled action to post to chatter a different message
What happens: I've been testing with creation of the record.
- The immediate chatter post occurs
- The scheduled chatter post does not.
I've tested back-dating the scheduled action (so that it would fire as soon as possible), but it also didn't occur. It's also not appearing in the paused flow interviews at all.
I'm trying to figure out why this happens.
- The criteria in the 2nd node is being met (the immediate action occurs)
- The criteria in the 2nd node is never changed to not be met (no other updates, field is still not null).
Out of interest, I've tested other scenarios as well
- When I selected "yes" for recursion for the process builder, it had 6 chatter posts from the immediate action and 5 scheduled action chatter posts.
- When I remove the field update from the PB and simply create a record with a value for that field in the UI, it works.
- When I remove the field update from PB and do it in a trigger (before insert), it works.
- If I separate out the scheduled action criteria/node into its own
separate PB with the same exact configuration (create/update, same
criteria), it works.
Best Answer
After working with Salesforce Support, the conclusion is that what I noted is buggy or unpredictable and there's a critical update to stabilize this behavior that will make it so you can not use a field update to meet the criteria of another node in the same process builder.
The critical update that will auto-activate in Summer ’23 (has been pushed back many times so check release notes) is Evaluate Criteria Based on Original Record Values in Process Builder. The Update Summary for that critical update mentions
As well as providing a longer description when you Review it.
Once this is activated, the behavior that is expected is that you can not do what I proposed in the question. The process builder will evaluate the record as it was when it entered the process and not take into account any updates you make in previous criteria nodes.
This is currently noted in the trailhead regarding order of process criteria