How to add groups in keycloak to an external database using Storage Providers

I was able to sync users from an external database to Keycloak and vice-versa using user storage providers. I need the same to happen with Groups and roles, but couldn’t find any solution so far. Can anyone help me with that?

Check out the mappers of user federation in keycloak, there is an option for ldap-groups or something like that.

The challenge I’m facing is I was able to create groups from my external database in keycloak using the realm model’s create group method. But if I add a group in keycloak and get that in my external database I wasn’t able to figure out how to get that done. I couldn’t find any provider that has the create group method like the one in user.