We Have a business requirement to only send email after a case is committed successfully. If for whatever reason the commit fails, we should not send an email.
We have many developments on the case that send emails, some are in flows, some in flow actions, some in activities, etc.
1- You can add stages in Pre and Post Stages in flow action. However Sending a notification in the post activity can never guarantee the commit after the post action will pass thus posting notification in the post activity is not an option
2- In flows, we can put send email shape, however the commit happens at the end shape so we can never guarantee that the commit will fail to not send an email.
What we tried to do is the following: Make a trigger with 'committed save' where in the trigger activity we send the notifications.
However to the contrary of the name 'trigger'. Turns out a trigger on committed save will run before the commit. Thus also there is no way to guarantee the commit will pass before sending the email.
Do you know a way to run an activity AFTER a successful commit?
You can try over riding the OOTB activity "commitWithErrorHandling" where on the commit step you can check the step status, if the status is good you can send the email. This activity is used in flow action commit's as well, so over riding this might help you.