hey, have you considered using sharepoint library premissions itself. when you select library settings; go to premissions and you can select premission types and who will have premissions to that library.
Thanks for you response. Thing is that I want to change the permissions of only one folder in de the Document set? I can do that manually in the SharePoint permissions after a new docment set is created but I would prefer to change the permissions via worflow.
The Nintex action Set Item Permissions can accomplish the same-ish functionality. We have a list shared by multiple groups - a choice field drives where the item is stored, and sets the appropriate permissions.
Perhaps you could do something similar - it would not actually set the folder perms, but anything in the folder would have item perms applied...