This article walks you through creating a validation rule using a record trigger flow instead of using apex code for complex business requirements. Sometimes we have requirements that can not be accomplished using standard validation rules. So you can use this approach instead of developing before insert apex trigger.
This articles covers a business requirement that before an opportunity is marked as closed won, the opportunity must have at least one contact role.