Okta Workflows how-to guides are questions and answers from weekly community office hours, #okta-workflows channel on MacAdmins Slack, and other places. Read all the other how-to guides.
On to the question.
How to check if a user is a member of a specific group in Workflows?
Check if a user in a group
The solution to check if a user is in a group is a helper flow. You can plug this flow into any other flow and reuse.

The flow has the following steps:
- The Helper Flow card has two inputs: User ID and Group name. You check if the user entered is a member of the group entered
- The Okta – Get Users Groups card takes a User ID and returns all the groups this user is in
- The List – Find card, searches if the Group name input matches any of the groups in the list returned. It searches only the Profile.Name path in the group list JSON. A sample of the JSON is shown below. The item output field is first item in the list that meets the specified criteria. The index output field is location of the item in the original list
- The Branching – Assign If card, checks if the index is greater than zero. If greater than zero (a match was was found), the return is set to true. If less than zero (a match was not found), the return is set to false
{
"Last Membership Updated": "2023-05-25T18:36:20.000Z",
"Last Updated": "2022-07-01T14:10:24.000Z",
"Profile": {
"Name": "No-code Automation",
"Description": "A group with awesome people"
}
...
},
{
"Last Membership Updated": "2022-11-17T17:36:33.000Z",
"Last Updated": "2022-06-24T19:32:06.000Z",
"Profile": {
"Name": "No-code Builders",
"Description": "Folks who build automations"
}
...
}
This is a flow run where the group name is matched:

This is a run where the group name is not matched:

Note that in the above screenshot, the index in the List – Find card is -1. It indicates no match is found.
What you learned
In this how-to guide, you learned how to check if a user is in a specific group.
More resources to help you learn:
π« Get help from Workflows specialists during weekly community office hours.
πΊ Learn from Workflows videos.
π Get help from support: discuss a Workflows topic or ask a question.
ππ»ββοΈ Join the #okta-workflows channel on MacAdmins Slack to learn and get help from the community.
Leave a comment