Task catalogue / Communication with Slack
Verified against Flow 5.0.0-beta.39
The Communication with Slack category has 13 tasks. Each entry shows the task's latest revision, the one the palette adds. See Reading an entry.
Create a Slack channel using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.create
create-slack-channeltemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Channel Name | name |
Text | Yes | Name of the public or private channel to create | |
| Private Channel | isPrivate |
Boolean | No | false |
|
| Team | team |
Text | No | Encoded team id to create the channel in |
Results
| Name | Description |
|---|---|
response |
The newly created slack channel |
Archives a Slack conversation using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.archive
delete-slack-channeltemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Channel ID | channel |
Text | Yes | ID of conversation to archive |
Results
| Name | Description |
|---|---|
response |
Status of the delete slack channel action |
Find a Slack user based on the provided email address using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/users.lookupByEmail
find-slack-member-by-emailtemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Email Address | emailAddress |
Text | Yes | An email belonging to a user in the workspace |
Results
| Name | Description |
|---|---|
slackUserId |
The slack user id |
Find a Slack user based on the provided user id using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/users.info
find-slack-member-by-idtemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| User | user |
Text | Yes | User id to get info on |
Results
| Name | Description |
|---|---|
response |
Slack user details |
Retrieves the Slack channel information using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.info
get-slack-channel-infotemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Channel | channel |
Text | Yes | Conversation ID to learn more about |
Results
| Name | Description |
|---|---|
response |
Slack channel details |
Retrieve the Slack channel members using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.members
get-slack-channel-memberstemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Channel | channel |
Text | Yes | Conversation ID to learn more about |
Results
| Name | Description |
|---|---|
response |
The list of the channel's member ids |
Retrieves the Slack channels using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.list
get-slack-channelstemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Team | team |
Text | No | Encoded team id to list channels in | |
| Channel Types | types |
Select | No | Channel types: private, public, mpim, im |
Results
| Name | Description |
|---|---|
response |
List of limited channel-like conversation objects |
Invite Slack users to a conversation using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.invite
invite-members-to-channeltemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Channel | channel |
Text | Yes | The ID of the channel to invite user(s) to | |
| Users | users |
Text | Yes | A comma separated list of user IDs |
Results
| Name | Description |
|---|---|
response |
Details of the extended invitation |
Removes a user from Slack conversation using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/conversations.kick
remove-member-from-channeltemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Authentication API Token | token |
Secured | Yes | $(workspace.params.slack-token) |
The token is associated with the slack application |
| Channel | channel |
Text | Yes | ID of conversation to remove user from. | |
| User | user |
Text | Yes | User ID to be removed |
Results
| Name | Description |
|---|---|
response |
The result of the removal action |
Send custom JSON payload to a specified Slack webhook URL. For more information on the underlying Slack API and potential configurations: https://api.slack.com/messaging/webhooks
send-custom-slack-messagetemplateParameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| URL | url |
Secured | No | ||
| Message Payload | message |
Text Editor | No |
No results.
Post to a Slack channel through an incoming webhook when a build is ready.
| Field | Value |
|---|---|
| Task name | notify |
| URL | $(workspace.params.slack-webhook-url), a secured workspace parameter that holds the webhook's URL |
| Message Payload | The payload below |
Message Payload
{
"text": "Build $(params.version) is ready",
"blocks": [
{
"type": "section",
"text": { "type": "mrkdwn", "text": "*Build $(params.version)* is ready for review." }
}
]
}The task posts the payload, as written, to the webhook, which posts to the channel it was created for. It returns no results. On the default task image, boomerangio/task-flow:3.3.0, Send Simple Slack Message and Send Slack Message with File Contents send nothing, so use this task for webhook messages, or move to boomerangio/task-flow:3.4.0.
| Symptom | Cause | Fix |
|---|---|---|
The task succeeds, but nothing reaches Slack, and the log shows an error such as Error: An HTTP protocol error occurred: statusCode = 404 |
The task doesn't fail when Slack refuses the message or can't be reached: it logs the error and ends Succeeded. A 400 means Slack rejected the payload; a 403 or 404, that the webhook URL is wrong, revoked or turned off. | After a first run, check View Log on the task, and fix the payload or the URL. |
The task succeeds, but the log shows SyntaxError and is not valid JSON |
Message Payload isn't valid JSON. A reference inserts its value as written, so a quote or line break in the value breaks the JSON. | Correct the payload, and keep values that can hold quotes or line breaks out of it. |
The task fails with URL has not been set |
URL is blank. | Enter the webhook's URL, or a reference to a secured parameter that holds it. |
Easily configurable slack webhook message. To provide additional parameters, please see our Custom Slack Message task.
send-simple-slack-messagetemplateWarning
Every revision sends nothing and ends succeeded on boomerangio/task-flow:3.3.0, the default task image: the task stops with ReferenceError: datetime is not defined in its log before it calls Slack. Send Custom Slack Message posts to the same kind of incoming webhook. Fixed in task-flow 3.4.0: set Default Image Path to boomerangio/task-flow:3.4.0.
Parameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Webhook URL | url |
Secured | No | ||
| Channel | channel |
Text | No | ||
| Icon | icon |
Text | No | ||
| Username | username |
Text | No | Name displayed as the sender of the slack message | |
| Message | message |
Text Area | No |
No results.
Send slack message with file contents via webhook
send-slack-message-with-file-contentstemplateWarning
Every revision sends nothing and ends succeeded on boomerangio/task-flow:3.3.0, the default task image: the task stops with ReferenceError: datetime is not defined in its log before it calls Slack. Send Custom Slack Message posts to the same kind of incoming webhook. Fixed in task-flow 3.4.0: set Default Image Path to boomerangio/task-flow:3.4.0.
Parameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Webhook URL | url |
Secured | No | ||
| Channel | channel |
Text | No | ||
| Icon | icon |
Text | No | ||
| Username | username |
Text | No | Name displayed as the sender of the slack message | |
| Message | message |
Text Area | No | ||
| File Content | content |
Text Area | No | ||
| Decode File Content | encoded |
Boolean | No | false |
|
| Context | context |
Text | No |
No results.
Upload a message to Slack using a Slack application through Bot tokens. For further reading on the underlying API see https://api.slack.com/methods/files.upload
upload-slack-file-with-messagetemplateWarning
Every revision calls a Slack method that Slack has retired, so the task fails. To post text through an incoming webhook, use Send Custom Slack Message. See Upload Slack File with Message fails.
Parameters
| Label | Name | Type | Required | Default | Helper text |
|---|---|---|---|---|---|
| Token | token |
Secured | No | $(workspace.params.slack-token) |
|
| Channel | channel |
Text | No | ||
| Message | message |
Text Area | No | ||
| File Name | fileName |
Text | No | Filename of file. | |
| File Content | fileContent |
Text Area | No | File contents via a POST variable | |
| Decode File Content | encoded |
Boolean | No | false |
|
| File Path | filePath |
Text | No | Full path to desired file | |
| File Title | fileTitle |
Text | No | Title of file. |
No results.