channel/invite
Invites one or more users to a Slack channel. Supports batch invitations using a comma-separated list of Slack user IDs. Requires channels:manage scope for public channels or groups:write for private channels.
When to Use
- Employee onboarding: Automatically add new hires to the standard set of team channels (e.g.,
#general,#team-engineering,#announcements) as part of the HR onboarding workflow. - Project kickoff membership: When a project is created in your project tracker, invite all assigned team members and stakeholders to the project channel.
- Contractor access provisioning: Batch-invite contractors to the specific channels relevant to their engagement when their access is provisioned.
- Directory sync: Sync channel membership from an external directory service (e.g., LDAP, Okta groups) to keep Slack channels aligned with HR roles.
Configuration
Connection
| Field | Type | Required | Description |
|---|---|---|---|
botToken | string | Required | Bot Token starting with xoxb-. Requires channels:manage (public) or groups:write (private) scopes. |
Operation Fields
| Field | Type | Required | Description |
|---|---|---|---|
channelId | string | Required | The channel to invite users into. Starts with C (public) or G (private). |
userIds | string | Required | Comma-separated list of Slack user IDs to invite. Example: U01USER12345,U01USER67890. Max ~1000 users per call. |
Pre-invite Check: Use
channel/getMembers to verify users are not already in the channel before inviting. Inviting an already-present user returns already_in_channel which can be safely ignored but adds noise to error logs.
Sample Configuration
{
"operation": "channel/invite",
"connection": {
"botToken": "{{credentials.slackBotToken}}"
},
"fields": {
"channelId": "{{$json.channelId}}",
"userIds": "{{$json.userIds.join(',')}}"
}
}
Validation Errors
| Error Code | Cause | Resolution |
|---|---|---|
user_not_found | One or more user IDs in the list do not exist or are deactivated. | Validate user IDs against the Slack directory using user/get before inviting. Filter out deactivated users. |
already_in_channel | One or more users are already members of the channel. | Pre-check membership with channel/getMembers and filter out existing members. This error can typically be ignored in batch flows. |
cant_invite_self | The bot is attempting to invite itself. | Filter the bot's own user ID from the userIds list. Use channel/join to add the bot to a channel. |
channel_not_found | The channel ID does not exist or the bot does not have access. | Verify the channel ID. For private channels, the bot must already be a member to invite others. |
missing_scope | Bot token lacks channels:manage or groups:write scope. | Re-authorize the Slack app with the required scopes. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
channelId | string | The channel ID users were invited to. |
invitedUserCount | number | Number of users successfully invited. |
status | string | success or error. |
errorCode | string | Slack error code when status is error. |
payload | object | Full raw Slack API response. |
Error Port
On failure with Continue on Error enabled, routes to the error port with status: "error" and populated errorCode. For batch invites, consider logging already_in_channel as a warning rather than an error.
Sample Output
{
"channelId": "C08AB3XYZ12",
"invitedUserCount": 3,
"status": "success",
"errorCode": "",
"payload": {
"ok": true,
"channel": {
"id": "C08AB3XYZ12",
"name": "project-alpha-launch",
"members": ["U01USER12345", "U01USER67890", "U01USER11111"]
}
}
}
Expression Reference
| Expression | Result |
|---|---|
{{$node["channel-invite"].json.channelId}} | The channel that was acted on — use in confirmation messages. |
{{$node["channel-invite"].json.invitedUserCount}} | Count of users invited — use in audit log entries. |
{{$json.userIds.join(',')}} | Join an array of user IDs into the comma-separated string required by this operation. |
{{$node["channel-invite"].json.status === "success"}} | Boolean success gate — use in IF node to branch on outcome. |
Node Policies & GuardRails
| Policy Area | Recommendation |
|---|---|
| Scope requirements | Requires channels:manage for public channels and groups:write for private channels. |
| Rate limiting | Tier 2 (20+ req/min). For bulk onboarding flows inviting users to many channels, add a Wait node between iterations. |
| No hard-coded IDs | Always source both channelId and userIds from upstream expressions or data stores. Never hard-code user or channel IDs. |
| Pre-invite membership check | Use channel/getMembers before inviting to filter out already-present users. This prevents noisy errors in batch workflows. |
| Bot self-invite prevention | Always filter the bot's own user ID from the userIds list. Use channel/join for the bot's own channel membership. |
| Access audit trail | Log each invite action with channelId, userIds, and timestamp to your audit system for access control compliance. |
Examples
Example 1 — New Employee Onboarding Channel Provisioning
When HR creates a new employee record, this workflow invites them to their team's standard channels.
// $json.newEmployeeSlackId = "U01NEWEMP123"
// $json.teamChannels = ["C08GENERAL01", "C08TEAMENG01", "C08ANNOUNCE01"]
// Loop over channels:
{
"operation": "channel/invite",
"fields": {
"channelId": "{{$json.channelId}}",
"userIds": "{{$json.newEmployeeSlackId}}"
}
}
Example 2 — Project Kickoff — Batch Invite Stakeholders
When a project is created, invite all assigned team members and the PM to the project channel in a single call.
// Code node: build user ID list from project members + PM
const userIds = [
...$json.teamMemberIds,
$json.projectManagerId
].filter(id => id !== "U01BOT99999").join(',');
{
"operation": "channel/invite",
"fields": {
"channelId": "{{$node['channel-create'].json.channelId}}",
"userIds": "{{userIds}}"
}
}
Example 3 — Directory Sync — Add Missing Members
Scheduled sync that compares an Okta group membership list with current Slack channel members and invites anyone missing.
// Node 1: HTTP Request → GET Okta group members → extract Slack user IDs
// Node 2: channel/getMembers → get current channel members
// Code node:
const oktaIds = $node["okta-members"].json.slackUserIds;
const slackIds = $node["channel-getmembers"].json.members;
const toInvite = oktaIds.filter(id => !slackIds.includes(id));
if (toInvite.length > 0) {
return { userIds: toInvite.join(',') };
}
// Node 3: channel/invite with toInvite list