Portal Community

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

Configuration

Connection

FieldTypeRequiredDescription
botTokenstringRequiredBot Token starting with xoxb-. Requires channels:manage (public) or groups:write (private) scopes.

Operation Fields

FieldTypeRequiredDescription
channelIdstringRequiredThe channel to invite users into. Starts with C (public) or G (private).
userIdsstringRequiredComma-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 CodeCauseResolution
user_not_foundOne 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_channelOne 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_selfThe 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_foundThe 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_scopeBot token lacks channels:manage or groups:write scope.Re-authorize the Slack app with the required scopes.

Output

Success Port

FieldTypeDescription
channelIdstringThe channel ID users were invited to.
invitedUserCountnumberNumber of users successfully invited.
statusstringsuccess or error.
errorCodestringSlack error code when status is error.
payloadobjectFull 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

ExpressionResult
{{$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 AreaRecommendation
Scope requirementsRequires channels:manage for public channels and groups:write for private channels.
Rate limitingTier 2 (20+ req/min). For bulk onboarding flows inviting users to many channels, add a Wait node between iterations.
No hard-coded IDsAlways source both channelId and userIds from upstream expressions or data stores. Never hard-code user or channel IDs.
Pre-invite membership checkUse channel/getMembers before inviting to filter out already-present users. This prevents noisy errors in batch workflows.
Bot self-invite preventionAlways filter the bot's own user ID from the userIds list. Use channel/join for the bot's own channel membership.
Access audit trailLog 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