We can add devices to existing groups based on queries , however you cannot create a group dynamically.
For examples where we have devices belonging to customers if we want to create a group for each customer , we have to create the new groups in addition to adding the devices.
It would be convenient to be able to define a rule for example: Create group based on unique variable in custom property CustomerTag. Then a generic query could be created for each group of this type which ensure that its members are added when the node.customertag = <Group Name>.
Then if I create 4 devices with CustomerTag = acme1, acme2, acme3, acme4. SW would automatically create me these groups and populates them with the devices.