userGroup/getUsers
Retrieve the list of user IDs that are members of a specific Slack User Group. Returns all member IDs for the group, optionally including members of disabled groups.
When to Use
- Verify that a specific user is in the on-call group before routing an incident page to them.
- Retrieve all group members to send each a targeted direct message as part of a bulk notification workflow.
- Sync group membership to an external access control or identity management system.
- Audit the membership of a security or access control group to ensure it matches expected composition.
- Fetch current members before calling
userGroup/addUsersto safely add a user without replacing others.
Add User Safely: Before adding a single user with
userGroup/addUsers, always call userGroup/getUsers first to retrieve the current membership list, then append the new user ID and pass the complete updated list. userGroup/addUsers replaces the entire membership, not appends.Configuration
Connection
| Field | Required | Description |
|---|---|---|
botToken | Required | Slack Bot Token starting with xoxb-. Requires the usergroups:read OAuth scope. |
Operation Fields
| Field | Required | Description |
|---|---|---|
userGroupId | Required | The Slack user group identifier (starts with S). Obtain from userGroup/getMany or userGroup/create. |
includeDisabled | Optional | Boolean. Default true. When true, includes members of disabled groups. Set to false to return empty results for disabled groups. |
Sample Configuration
{
"operation": "userGroup/getUsers",
"connection": {
"botToken": "{{ $credentials.slackBot.token }}"
},
"userGroupId": "S08ONCALL01",
"includeDisabled": true
}
Validation Errors
| Error Code | Cause | Resolution |
|---|---|---|
no_such_subteam | No user group with the given ID exists in the workspace. | Verify the group ID using userGroup/getMany. |
missing_scope | Token lacks the usergroups:read scope. | Add usergroups:read under OAuth & Permissions and reinstall the app. |
invalid_auth | Bot token is invalid or revoked. | Regenerate the token and update the credential store. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
userCount | number | Total number of members in the group. |
userIds | array | Array of Slack user ID strings (each starting with U). Empty array if the group has no members. |
status | string | "success" on successful retrieval. |
errorCode | string | Empty on success. Slack API error code on failure. |
payload | object | Raw Slack API response. |
Error Port
Activated when the group does not exist or the token lacks read permissions. An empty userIds array is a valid successful response for groups with no members.
Sample Output
{
"userCount": 3,
"userIds": ["U01ENG001", "U01ENG002", "U01ENG003"],
"status": "success",
"errorCode": "",
"payload": {
"ok": true,
"users": ["U01ENG001", "U01ENG002", "U01ENG003"]
}
}
Expression Reference
| Expression | Result |
|---|---|
{{ $output.getGroupUsers.userIds }} | Full array of member IDs — pass to loop node for bulk operations or to userGroup/addUsers for safe append. |
{{ $output.getGroupUsers.userCount }} | Group member count for logging or reporting. |
{{ $output.getGroupUsers.userIds.join(',') }} | Comma-separated user IDs string — pass directly to userGroup/addUsers after appending a new ID. |
Node Policies & GuardRails
| Policy Area | Recommendation |
|---|---|
| Safe Append Pattern | Always call userGroup/getUsers before userGroup/addUsers when adding a single member. addUsers replaces the entire list — omitting this step will remove existing members. |
| Empty Group Handling | An empty userIds array is a valid result. Always handle the zero-member case in conditional branches downstream. |
| Membership Verification | To check if a specific user is in a group, retrieve the userIds array and check if the target user ID is included. There is no direct "is user in group" API call. |
| External Sync | When syncing group membership to external systems, include the group ID and sync timestamp alongside the member list for auditability. |
| Rate Limits | Slack's usergroups.users.list is Tier 2. Avoid calling this in tight loops — fetch once and cache for the workflow execution. |
Examples
Verify User is On-Call Before Routing Incident
Before routing an incident DM, confirm the target user is currently in the on-call group.
{
"operation": "userGroup/getUsers",
"userGroupId": "S08ONCALL01"
}
// Check: $output.getGroupUsers.userIds.includes($input.targetUserId)
Safe Add User to Existing Group
Add a new member to the @reviewers group without removing existing members.
// Step 1: Get current members
{
"operation": "userGroup/getUsers",
"userGroupId": "S08REVIEWS1"
}
// Step 2: Build new list: [...$output.getGroupUsers.userIds, $input.newUserId].join(',')
// Step 3: addUsers with the complete updated list
Sync Group Membership to External System
Retrieve group members and write them to an external access control system for audit.
{
"operation": "userGroup/getUsers",
"userGroupId": "{{ $input.accessGroupId }}",
"includeDisabled": false
}
// Write { groupId, userIds, syncedAt } to access control database