I would like to know if it is possible to make that the shape of groups non rectangular and adapt to the placement of its members. For instance, if some nodes are placed in a L shape, the group would take a L shape if I group the nodes.
Yes, it is possible, but there is no built-in support for that. You will need to dynamically compute the geometry.
If you have additional constraints on the user’s behavior, such as limiting the dragging of nodes to stay within that geometry, we do have functionality for that that you could use.