How to delete user from a group once disconnected

I want built user to user relationships named connections (connected, disconnected ) and one can add each other to their group but only one can only add other users if connected to their group and once disconnected remove that user from all of the group created by that person with which he was connected

We don’t currently have a way to have an action that would update multiple records at once such as all the Groups that that User was a member of.