Yesterday I had to implement a custom Action/Activity to satisfy the requirements of a particular scenario at a client engagement. I needed an Action for our SharePoint Designer workflows that could assign a permission level/role to a list item.
I did not canvas the web looking for an existing piece of work to accomplish this for several reasons, but in my travels I also did not notice an activity like this one.
The custom activity is your basic custom class inheriting from Workflow.ComponentModel.Activity, so nothing special here. I implemented 4 overridden static properties of type DependencyProperty to get the execution context, the list and list item IDs, and the person for whom the permissions are being granted.
A unusually convenient built-in behavior of using a Person field is that is provide the login ID of the specified person. This is handy as you need their domain ID to implement the RoleAssignment object you will use to grant the user their permissions.
The basic heart of the implementation is 4 lines of code, plus the addition, or alteration, of a custom .actions file in the /Template/1003/Workflow folder to declare the activity inputs, text displayed, etc. Below is how the activity appears in SharePoint Designer.