Get User Groups
This service task retrieves all groups that a specific user is a member of.
Benefit: Processes can make decisions based on a user's group memberships — route tasks to the right team, apply group-specific rules, or validate permissions automatically.
How it works
Each user in Pantarey can be assigned to one or more groups.
This service task looks up all group memberships for a given user (identified by their Cognito userSub).
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userSub |
String | Yes | The Cognito user sub (unique user ID) to look up. |
Example Input
{
"userSub": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Output
| Field | Type | Description |
|---|---|---|
userSub |
String | The user ID (echoed back). |
totalCount |
Number | Number of group memberships. |
groups |
Array | List of groups the user belongs to. |
Each group contains:
| Field | Type | Description |
|---|---|---|
groupName |
String | The group identifier. |
displayName |
String | The human-readable group name. |
Example Output
{
"userSub": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"totalCount": 2,
"groups": [
{ "groupName": "sales", "displayName": "Sales" },
{ "groupName": "support", "displayName": "Customer Support" }
]
}
Use Cases
- Role-based routing: Check if a user belongs to "management" before allowing an approval step.
- Dynamic task assignment: Assign follow-up tasks based on the initiator's group memberships.
- Access validation: Verify a user is in the correct group before granting access to a resource.
- Profile enrichment: Add group information to process variables for downstream steps.
Notes
- If the user has no group memberships,
totalCountis 0 andgroupsis an empty array. - The
userSubis the Cognito user identifier, not the email address.