Get Group Members
This service task retrieves all users that are members of a specific group.
Benefit: Processes can automatically identify all people in a team or department — send notifications to all sales reps, assign tasks to support agents, or count team members for capacity planning.
How it works
Given a group ID, this service task queries all user assignments for that group and returns the list of members with their user IDs and display names.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupId |
String | Yes | The ID of the group whose members should be retrieved. |
Example Input
{
"groupId": "sales"
}
Output
| Field | Type | Description |
|---|---|---|
groupId |
String | The group ID (echoed back). |
totalCount |
Number | Number of members in the group. |
members |
Array | List of group members. |
Each member contains:
| Field | Type | Description |
|---|---|---|
userSub |
String | The Cognito user sub (unique user ID). |
displayName |
String / null | The display name of the user, if available. |
Example Output
{
"groupId": "sales",
"totalCount": 2,
"members": [
{ "userSub": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "displayName": "Max Mustermann" },
{ "userSub": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "displayName": "Erika Muster" }
]
}
Use Cases
- Bulk notifications: Send a message or email to all members of a group.
- Task distribution: Assign tasks round-robin across group members.
- Capacity check: Count members before routing work to a team.
- Escalation: If a group has no members, escalate to a fallback group or manager.
Notes
- If the group has no members,
totalCountis 0 andmembersis an empty array. - The
displayNamemay benullif no display name was set when the user was assigned. - Use List All Groups to discover available group IDs.