> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/processes/process-steps/process-step-settings/working-with-step-assignee.md).

# Working with step assignee

## Setting step assignee

User can set different types of Step Assignee:

* Users
* Field (assignee IDs are got from Data Source Object record fields)
* Group
* Chatter Group
* Queue
* Role
* Profile
* Permission set
* Variable (assignees are got from variable)
* Apex class
* Query (assignees are returned as a result of database query)
* Resource (Starting release 6.0)
* Resource Pool (Starting release 6.0)
* System (Automatic)

User can set or change Step Assignee in these places:

* Process builder (Responsibility) - in Responsibility Properties sidebar
* Responsibility Override - in Step properties sidebar
* Process details - in the "Assignee" tab of Progress Component. Need to enable Assignee tab in Step Properties.
* Task Manager (Kanban) - on "Assignee" tab of card layout. Need to enable Assignee tab in Step Properties.
* Escalation - step can be escalated to another assignee by Escalation or Duration Expiration Handler.
* Actions - by calling proper method of Apex class (e.g., `WorkflowService.changeAssignee()` method).

## User(s) as step assignee

Go to Responsibility or Step "Properties" and select "User" as "Assign Type" (1):

![](/files/82464cc56891c0b3a6f87e71e4abacc0f38832cc)

Click "Add Users" link (2) to show a popup with users picker (3). Select one or more users (up to 10) by simple mouse clicking (selected users will be highlighted with light blue):

![](/files/f4b6f847399b00a09b590a5392193a1b1be34006)

{% hint style="info" %}
Type part of user name and click "Search" button (4) for quick filtering.
{% endhint %}

Click "Add" button. Added users will be shown under "Assign Type" field:

![](/files/c60b18700bb1ff1a82fdcd9eff8c06128e69b23e)

Click "Remove User" button (5) to get rid of unneeded assignee.

## Field as step assignee

Select "Field" as "Assign Type" and click "Add Fields" button (6) to call a Fields Picker (7):

![](/files/82e5f760c33562ff41f54b7f56fda4c01da10f87)

![](/files/28b951ac5ea5255c17b240d7f2b1043abe77c975)

Select necessary field(s) (up to 5) by mouse clicking and click "Add" button. The added fields will be shown under "Assign Type":

![](/files/5032fd666cf3598a342737a45ef156dad12490a3)

## Group, Chatter Group, Queue, Role, Profile, Permission Set as step assignee

Select one of these types in "Assign Type" field and click proper "Add..." link to show proper picker (8):

![](/files/bd28406f1945c52c4f27bdd68fa658caf26624db)

Select a Group / Chatter Group / Queue / Role / Profile / Permission set (only one can be selected) and click "Add" button. The selected assignee(s) will be shown under "Assign Type":

![](/files/18524c368fb4f5a5b5e5cf8491d280289c4f4bc9)

{% hint style="info" %}
Groups, Chatter Groups, Queues, Roles, Profiles, Permission Sets should be properly configured before they can be used here.
{% endhint %}

## Variable as step assignee

Select "Variable" in "Assign Type" field and click "Add Variable" link to show variables picker (9):

![](/files/32721a21514ae4e4d61082514a4b6cc25a95ceb9)

Select a variable (only one allowed) and click "Add" button. Selected variable will be shown under "Assign Type" field:

![](/files/9f040cf6779cf1bdc3e40a9c8bc15cb5a4d05ecf)

{% hint style="info" %}
Variable should be defined somewhere in process builder (e.g., on "Define Variable" step action) before it can be used here.
{% endhint %}

## Apex class as step assignee

Select "Call Apex" in "Assign Type" field and click "Add Apex Class" link to show classes picker (11):

![](/files/76525f322c6c6fafef16b17e9d26e276388db1d9)

Select necessary class and click "Add" button. Selected lass will be shown under "Assign Type":

![](/files/53ac9edbb7308b53bec04d8760bf07a10b84b140)

Apex class should implement `WR_BPM.WorkflowAssigneeInterface` method.

Execute method should return string with assignee id(s). It can be single user id, multiple users ids (comma separated), profile id, role id etc.

Example:

Based on Responsibility name code below defines different assignees for each Responsibility:

{% code overflow="wrap" lineNumbers="true" %}

```apex
global with sharing class WR_ApexAssignees implements WR_BPM.WorkflowAssigneeInterface {
     public String execute(sObject context, WR_BPM__Flow_Instance_Cursor__c flowInstanceCursor, WR_BPM__Flow_Step_Junction__c step)
     {
        if(step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility A')
        {
            // code to query assignee data
            // process name is: WR_BPM__Flow__r.WR_BPM__Process__r.Name
            // version (flow) name is: WR_BPM__Flow__r.Name
            return '0056A000000YP12';
        }
        else if (step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility B')
            return '0056A000000YP1M,0056A000000YP12';
        else if(step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility C')
            return '00e6A000000E1aG';
        else if(step.WR_BPM__Flow_Swimlane__r.name == 'Responsibility D')
            return '00G6A000000LjpX';
        else
            return null;
     }
}
```

{% endcode %}

## Query as step assignee

Select "Query" as "Assign Type. By default query conditions are not set, so, click "set" link (12) to show "Edit Query Conditions" popup (13):

![](/files/aed214ddab46e0a9e4781d1c3a1a8c6d15b0c20e)

![](/files/fbb777d25786c1fcf376af7da270cb92774d79bf)

Set necessary query conditions (14) and click "Apply" button (15). Query information will be shown under "Assign Type":

![](/files/18f43d9bd90b275e9499190c02ba90b75f92ffb1)

Click "Edit" link (16) to change Query conditions.

## System as step assignee

Responsibility or step can be assigned to system for automatic processing.

To make Responsibility system just check "System" checkbox (17):

![](/files/913bc0f73cd288320dd378ab752e3eabfa4934e6)

and confirm this in the popup appeared:

![](/files/47f79c4a914b0617e4040bd9b3e88f4485537573)

To make particular step system (automatic) select proper option (18) in the "Step Type" picklist:

![](/files/d171692efd4f14908c16ba7fd52be9e605f17656)

Also step can be added as automatic initially by dragging proper shape from "Elements" section of left sidebar.
