Save Selected group to json

Hi guys,
is there any way to save a group (with many node inside it) to json?

Assume i create a diagram, after that take some of the nodes and make a group(Group 1 as you can see in the pic). is there any way to save this group to json and then load it again in another diagram as one group?
Thanks in advance

Model.toJson (and Model.fromJson) will save (and load) all of the node data in the model. Because Group is a subclass of Node, that will include all groups.

So everything should just work, assuming each group data object has all of the properties needed by the group template that you are using.