Grouping in-app notifications based on where they come from, who triggered them, and what the actions are

I'm working on a project where I'm defining the UX for web in-app notifications. The app is quite similar to task management apps, kind of like Asana, Monday, etc. Now for example, if we have a user subscribing to notifications from 20 tasks, and other team members keep making changes on these tasks, the user is supposed to receive notifications for all these changes. What I'm trying to do here is reduce the number of notifications received by the user by grouping the notification based on where they come from (the task), who triggered the notifications (the user), and What is the notification type (Description edit, title edit, due date edit, etc.). For further clarification, If User X adds a subtask to task A, then user Y added another subtask 1 hour later to task A as well, the system could group these 2 notifications into a single one saying that User X & User Y added subtasks to task A. This way the system reduced 2 notifications into 1.

Does anyone know of a good guide or good rule of thumb on how I can design a system like that?