节点 / builtin / integration
Slack
Integrate with Slack to perform operations on channels, messages, users, and files.
此内容尚不支持你的语言。
Post, read, edit and search Slack messages, look up channels and people, and share files, from a workflow.
What it does
Section titled “What it does”The Slack node works on four kinds of things (Resource), each with its own Operation:
- Channel: list the channels the token can see, or get one channel’s details.
- Message: send, read, update, delete or search messages.
- User: list workspace members, or get one person’s profile.
- File: upload a file to channels, or get a file’s details.
It cannot create or archive channels, or manage members.
Channel, User and Message fields are lists loaded from your workspace once a credential is set, so you can pick instead of typing ids. You can still type an id or use an expression.
When to use it
Section titled “When to use it”- Post an alert when something changes: a price drop, a new form entry, a failed run.
- Send a daily digest built by earlier nodes to a channel.
- Upload a screenshot or a generated file to a channel.
- Search past messages and pass them to an AI node.
Inputs and settings
Section titled “Inputs and settings”| 设置项 | 类型 | 作用 |
|---|---|---|
| Credential (必填) | Credential | The Credential to use to make the request. |
11 个选项 · 选择“Resource and Operation”以查看其设置
Channel · Get many 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Limit | Number | Number of results to return (1-1000). 默认值:100 |
Channel · Get info 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Channel (必填) | Choice (loaded from your account) | The Slack channel to work with. |
Message · Send 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Channel (必填) | Choice (loaded from your account) | The Slack channel to work with. |
| Text (必填) | Text | The message text. |
| Thread Timestamp | Text | The thread timestamp to reply to. |
| Blocks | List | Slack block elements for rich formatting. |
| Attachments | List | Message attachments. |
| Username | Text | Override the default username. |
| Icon Emoji | Text | Override the default icon with an emoji. |
Message · Get 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Channel (必填) | Choice (loaded from your account) | The Slack channel to work with. |
| Limit | Number | Number of results to return (1-1000). 默认值:100 |
Message · Update 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Channel (必填) | Choice (loaded from your account) | The Slack channel to work with. |
| Message (必填) | Choice (loaded from your account) | The message ID to work with. |
| Text (必填) | Text | The message text. |
| Blocks | List | Slack block elements for rich formatting. |
| Attachments | List | Message attachments. |
Message · Delete 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Channel (必填) | Choice (loaded from your account) | The Slack channel to work with. |
| Message (必填) | Choice (loaded from your account) | The message ID to work with. |
Message · Search 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Search Query (必填) | Text | The search query for messages. |
| Limit | Number | Number of results to return (1-1000). 默认值:100 |
User · Get many 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Limit | Number | Number of results to return (1-1000). 默认值:100 |
User · Get info 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| User (必填) | Choice (loaded from your account) | The Slack user to work with. |
File · Upload 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Binary source | Text | The logical $binary key on the incoming item to send as the file (defaults to 'data'). Fed automatically from an upstream node that produces a binary (e.g. HTTP Request, Screenshot). 默认值:data |
| File | File | The file to upload. |
| Channels | List | Channels to share the file with. |
| Initial Comment | Text | Add a comment when uploading the file. |
| Thread Timestamp | Text | The thread timestamp to reply to. |
| File Title | Text | Override the file name. |
File · Get 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| File ID (必填) | Text | The ID of the file to retrieve. |
正在显示 Channel · Get many 的设置
To reply in a thread, put the parent message’s timestamp in Thread Timestamp (Slack’s ts, for example 1712345678.123456). For File → Upload, the file comes from the incoming item’s $binary data (the key named in Binary source, data by default), as produced by Http Request, Screenshot Page or Convert to File.
Outputs
Section titled “Outputs”-
Output
Get many and Get (messages) return a list, one item per channel, user or message. Send returns the posted message, including its ts, which you can reuse to update, delete or reply to it. Search returns the matching messages.
Dependencies and credentials
Section titled “Dependencies and credentials”- Credential (connection, Bearer Token): required. See Connect Slack.
Use a Slack bot or user token. The token’s scopes decide what works: for example chat:write to send, channels:read to list channels, search:read (user token) to search, files:write to upload. See Create a credential.
Example workflow
Section titled “Example workflow”- A Schedule trigger runs every weekday at 9:00.
- RSS Feed Read and Limit pick the 3 newest posts.
- Aggregate puts them in one item.
- Slack, Message → Send, to
#news, with a Text listing the titles and links.
Common issues
Section titled “Common issues”- The run is blocked in the web app. Slack runs through the browser extension. Install the extension and allow Slack for this workflow when asked, or run the workflow from the extension.
- “missing_scope” or “not_allowed_token_type”. The token lacks the scope for this operation. Add the scope in your Slack app settings, reinstall the app to the workspace, and update the credential.
- “not_in_channel”. Invite the bot to the channel (
/invite @your-bot) before sending to it. - “Slack file upload: no binary found on the incoming item”. The previous node did not produce a file under the key in Binary source. Check the key, or add a node that produces a file.
- The channel list is empty. Set the credential first; the list loads from Slack with it.
Related nodes
Section titled “Related nodes”- Discord and Telegram: other chat apps.
- Push Notification: a message to your phone.
- Browser Notification: a desktop notification, no account needed.
- Http Request: call Slack API methods this node does not cover.