
Scenario : There could be a business need to automatically add the users (On creation/updation) to particular queue or group based on some condition.
To implement this need I am going to use the Salesforce automation tool ~ Process Builder and Flow.
Step 1:
Create queue as per your requirement.
- ABC
- CDE
Step 2:
Create a flow
Create variables to store the values from process builder & decision outcome. In flow builder Goto > Manager tab >> click on “New Resource”.



Go to > ‘Element’ tab > Drag decision box in the flow builder page. Enter the required fields and add decisions (use previously created variable in resource).


Drag ‘Get Records’ element on flow builder page. This is used to find the record and store the value in previously created variable (QueueID).


Similarly add another ‘Get Records’ element to get ‘CDE’ queue record id.
Connect ‘Start’ with ‘Decision’ element and ‘Decision’ element to both ‘Get Records’ elements.
Drag ‘Create Records’ element on flow builder page. Enter the Label and others details (See screen below).

Save and Activate. Final flow will look like below:

Step 3:
Now, create a Process Builder on user object.
Note: If a Process Builder is already exists on user object in org. Do not create another one, it is best practice to use only one process for an object.
Goto Setup > Search ‘Process Builder’ > Under Process Automation – click on Process Builder.

Select object (User) and start process would be ‘when a record is created or edited’
Add criteria:

Add Action:

Save and Activate.
Now, update user with Job=ABC. You can see this user will be automatically added in the ABC queue.
Thanks
Arun Kumar