Flocking Behavior while Pathfinding

As the title states, I am trying to add flocking behavior to pathfinding.

The issue is not only that I’m a bit lost on how to achieve this, but also that the only real resource I could find is this video.

I’ve tried searching the devforums for solutions, and searched for videos on this topic, but there’s either almost none, or they don’t post any sources, the video above, and this post are the only real resources I have, since most other resources I found aren’t even in 3D.

And if there’s any confusion on the whole “flocking while pathfinding”, here is an image of what I am talking about:

I’m not asking for entire scripts to be written I’m just wondering if anyone can point me to some better sources.

You may be interested in boids.

I have heard of boids before, and to my understanding they’re about the same as the flocking system I am trying to achieve.
I believe that in the video linked in the topic(this one) they mention boids, and following his tutorial I’ve tried pathfinding from the average position, but they don’t follow the path and instead just go for the most direct path, which just leads to them running into the walls.