What happens to workflow when a step has no assignees / an assignee user account no longer exists?

Sometimes a workflow step may have defined an assignee by user that is no longer registered on the website or a role has been removed. In such a case, that workflow step would essentially be skipped over. The reason for this behaviour is to ensure that the workflow still keeps processing to avoid a process bottleneck or ending abruptly. However, there are scenarios where having that workflow step be completed by someone is essential to any further steps in the workflow. If this is something your use case requires, we suggest customization using the gravityflow_step_assignees filter.

Here's one example approach, applicable for a specific step (#63), where the administrator role will be added if the current step settings lead to no assignees being defined:

add_filter( 'gravityflow_step_assignees', 'sh_step_assignees_role_field_value', 10, 2 );
function sh_step_assignees_role_field_value( $assignees, $step ) {
    if ( $step->get_id() == 63 ) {
        if ( empty( $assignees ) ) {
            $args = array(
                'id'  => 'administrator',
                'type' => 'role',
                'key' => 'role|administrator',
            );
            $new_assignee = new Gravity_Flow_Assignee( $args, $step );
            $assignees[] = $new_assignee;
        }
    }
    return $assignees;
}

This snippet would be required to be added to the funcitons.php.