Slack Block
Send messages, manage channels, and interact with Slack
Slack Block
The Slack block provides comprehensive access to Slack messaging, channels, modals, and interactive components within your workflows.
Overview
Use the Slack block when you need to:
- Send notifications to channels or users
- Create approval workflows with interactive buttons
- Build rich messages with Block Kit
- Manage channels and users programmatically
- Upload files and add reactions
Prerequisites
- Slack Connection: Configure OAuth via Nango with
slackprovider - Bot Permissions: Bot must be added to target channels
- Scopes Required: Varies by action (see action-specific requirements)
Configuration
Step Definition
Configuration Fields
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | The Slack action to execute |
channel | string | Varies | Channel ID or name (e.g., #general, C1234567890) |
text | string | Varies | Message text (supports mrkdwn) |
blocks | array | Varies | Block Kit blocks for rich layouts |
user | string | Varies | User ID for user-specific actions |
Available Actions
Message Actions
sendMessage
Send a message to a channel or DM.
Required Scopes: chat:write, chat:write.public (for non-member channels)
Parameters:
| Field | Type | Description |
|---|---|---|
channel | string | Channel ID or name |
text | string | Message text (required if no blocks) |
blocks | array | Block Kit blocks |
threadTs | string | Reply to thread |
replyBroadcast | boolean | Also post to channel when replying |
unfurlLinks | boolean | Enable link previews |
unfurlMedia | boolean | Enable media previews |
mrkdwn | boolean | Enable mrkdwn formatting (default: true) |
attachments | array | Legacy attachments |
metadata | object | Message metadata |
Output:
sendEphemeral
Send an ephemeral message (only visible to one user).
Required Scopes: chat:write
Parameters:
| Field | Type | Description |
|---|---|---|
channel | string | Channel ID |
user | string | User ID to show message to |
text | string | Message text |
blocks | array | Block Kit blocks |
threadTs | string | Thread timestamp |
scheduleMessage
Schedule a message to be sent later.
Required Scopes: chat:write
Parameters:
| Field | Type | Description |
|---|---|---|
channel | string | Channel ID |
postAt | number/string | Unix timestamp or ISO 8601 datetime |
text | string | Message text |
blocks | array | Block Kit blocks |
Output:
updateMessage
Update an existing message.
Required Scopes: chat:write
Parameters:
| Field | Type | Description |
|---|---|---|
channel | string | Channel ID |
ts | string | Message timestamp to update |
text | string | New message text |
blocks | array | New Block Kit blocks |
deleteMessage
Delete a message.
Required Scopes: chat:write
getPermalink
Get a permanent link to a message.
Output:
Reaction Actions
addReaction
Add an emoji reaction to a message.
Required Scopes: reactions:write
Parameters:
| Field | Type | Description |
|---|---|---|
channel | string | Channel ID |
timestamp | string | Message timestamp |
name | string | Emoji name (without colons) |
removeReaction
Remove an emoji reaction.
File Actions
uploadFile
Upload a file to Slack.
Required Scopes: files:write
Parameters:
| Field | Type | Description |
|---|---|---|
channels | string/array | Channel(s) to share file |
content | string | Text content for the file |
file | string | Base64 encoded file content |
filename | string | Name of the file |
filetype | string | File type (e.g., csv, pdf) |
title | string | Title of the file |
initialComment | string | Comment to add with file |
threadTs | string | Thread to upload to |
getFile
Get file information.
deleteFile
Delete a file.
Modal/View Actions
openModal
Open a modal view (requires trigger_id from interactive event).
Required Scopes: None (uses bot token)
Parameters:
| Field | Type | Description |
|---|---|---|
triggerId | string | Trigger ID from interactive event |
view | object | Modal view definition |
updateModal
Update an existing modal.
Parameters:
| Field | Type | Description |
|---|---|---|
viewId | string | View ID to update |
externalId | string | Alternative: external ID |
view | object | Updated view definition |
hash | string | Optional hash for conflict detection |
pushModal
Push a new view onto the modal stack.
publishHomeTab
Publish content to a user's Home tab.
Required Scopes: None (uses bot token)
User Actions
getUser
Get user information.
Required Scopes: users:read
Output:
listUsers
List workspace users.
Required Scopes: users:read
lookupUserByEmail
Find a user by email address.
Required Scopes: users:read.email
Channel Actions
getChannel
Get channel information.
Required Scopes: channels:read, groups:read
listChannels
List channels.
Required Scopes: channels:read, groups:read
Parameters:
| Field | Type | Description |
|---|---|---|
types | string | Channel types (public_channel, private_channel, mpim, im) |
excludeArchived | boolean | Exclude archived channels (default: true) |
limit | number | Max results (default: 100) |
cursor | string | Pagination cursor |
createChannel
Create a new channel.
Required Scopes: channels:manage, groups:write
inviteToChannel
Invite users to a channel.
Required Scopes: channels:manage, groups:write
archiveChannel
Archive a channel.
setChannelTopic
Set channel topic.
getChannelHistory
Get channel message history.
Required Scopes: channels:history, groups:history
Bookmark Actions
addBookmark
Add a bookmark to a channel.
Required Scopes: bookmarks:write
Block Kit Examples
Rich Notification with Buttons
Status Update with Context
Template Variables
Access workflow data in your Slack configuration:
| Variable | Description |
|---|---|
{{input.field}} | Workflow trigger input |
{{steps.stepId.output.field}} | Previous step output |
{{variables.name}} | Workflow variables |
{{env.VAR}} | Environment variables |
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
channel_not_found | Invalid channel ID/name | Verify channel exists and bot has access |
not_in_channel | Bot not in channel | Invite bot to channel or use chat:write.public |
invalid_blocks | Malformed Block Kit | Validate blocks with Block Kit Builder |
trigger_expired | Stale trigger_id | Trigger IDs expire in 3 seconds |
missing_scope | Insufficient permissions | Add required OAuth scopes |
rate_limited | Too many requests | Implement backoff, respect retry-after |
Error Response
Rate Limits
| Tier | Limit | Description |
|---|---|---|
| Tier 1 | 1/min | Low-frequency methods |
| Tier 2 | 20/min | Most methods |
| Tier 3 | 50/min | High-frequency methods |
| Tier 4 | 100/min | Very high-frequency |
| Special | Varies | chat.postMessage: ~1/sec per channel |
Slack returns 429 Too Many Requests with Retry-After header when limits are exceeded.
Related Blocks
- Email Block - Send email notifications
- Action Steps - Other integration actions
- Condition Steps - Conditional logic
Example Workflow
Complete approval workflow with Slack: