Slack actions

Requirements

All Slack actions use the Slack Web API to perform recipe actions.

Before using Slack actions, you'll first need to create a Slack app. Check out our Slack trigger documentation to learn more about creating a Slack app.

Permission scopes

Slack actions are performed on behalf of the user by the connected Slack app. To perform each action, the app has must have the associated permission scope. For example, the Create channel action uses the channels.create method, which requires the connected Slack app to have the channels:write scope.

At the minimum, Slack actions require the following permission scopes:

  • channels:read
  • channels:write
  • chat:write:user
  • groups:read
  • groups:write
  • users:read
  • users:read.email

To add/remove permission scopes for your app, go to your Slack app's page (it should look something like 'https://api.slack.com/apps/{your_app_id}' — your app ID is unique to your app). Go to OAuth & PermissionsScopes to select your app's permission scopes.

Add permission scopes Remember to click 'Save changes' after selecting your permission scopes!

Event subscriptions & Permission scopes

Subscribing to events will automatically add scopes that your app does not already have. This may give your app unintended permissions from the additional scopes. After subscribing to events, we strongly recommend going to OAuth & PermissionsScopes to confirm your app's permission scopes.

Post message actions

The post message action posts a message to your specified channel or user. By default, messages are posted as bot user "Workato".

Workato post message

If a custom OAuth profile is used, the Slack app's name and icon will be used instead.

Custom ap post message

For more on custom OAuth profiles, go to our Custom OAuth profiles documentation.

How it works

Your post messages can just be a simple line of text, or it can include a combination of text, buttons, menus, icons & images — depending on your use case.

Input fields

Channel

You can post messages to channels (public & private), or to a specific user.

If you're using channel names to post messages to a channel, prefix them with '#', e.g. #support-ticket-101. Otherwise, use channel IDs & channel datapills as-is, e.g. CANUXC4MU or Channel respectively.

Channel datapill

Similarly, if you're using user names to post a direct message (DM) to a user, prefix them with '@', e.g. @johndoe. Otherwise, use user IDs & user datapills as-is, e.g. UA12345 or User ID respectively.

User datapill

Basic text

This is the most basic text field for a post message.

Basic text How it will look like in Slack

If Allow Slack formatting is enabled, you can tag users in the message by enclosing their user ID or user name with < >, e.g. <UA12345> or <@johndoe> for user ID and user name respectively.

Attachment title

This input adds an attachment title to the post message.

Attachment title How it will look like in Slack

When you provide a valid URL, this fields will hyperlink the attachment title, redirecting users there if clicked.

Attachment title link How it will look like in Slack

Attachment text

This field adds attachment text to the post message, below the attachment title.

Attachment text How it will look like in Slack

Attachment message fields

This field creates a two-column layout below the message text. Enter one name-value pair per line, e.g.Name: John.

Attachment message fields How it will look like in Slack

Buttons

This field adds a button to the post message. When this button is clicked, it triggers a button click event. Another recipe is required to handle this event. Learn more at about button click triggers in our Slack triggers documentation.

Button action handler recipes

This field lists any Slack recipes with a button click trigger. Choosing a recipe ensures that button clicks from this button will trigger it.

Button actions

This field specifies certain characteristics of the button. Enter one button action per line in this format:

action name, action ID, style, confirmation title, confirmation text, ok button title, dismiss button title

For non-danger styled actions, only the first 2 parameters need to be filled in, as there is no popup prompt generated. For danger styled actions, all 7 parameters need to be filled in, e.g.

Notify BizDev, bd, , , , ,

Here's an example of a danger-styled button.

Notify Sales, sales, danger, Confirm, Are you sure?, Yes, Cancel

A more detailed description of each button parameter can be seen in the table below.

Button definition input fields Description
Action name Button label visible to Slack user interacting with the buttons.
Action ID Internal value of the button. This needs to be unique. Not visible on Slack to anyone.
Style Leave this field as well as the remaining 4 fields blank for non-danger styled actions since no pop-up will be generated.
Otherwise, put danger to generate a red button with a pop-up prompt, requiring the user to confirm the button click. You will then need to fill up the rest of the fields too.
Confirmation title Shows up in the popup prompt as the header.
Confirmation text Shows up in the popup prompt as the body text.
Ok button title Button label in the popup prompt to confirm the button click.
Dismiss button title Button label in the popup prompt to cancel the button click.

Buttons How it will look like in Slack

Attachment color

This field allows you to choose the color of the vertical line to the left of the message.

Attachment color How it will look like in Slack

Thumb URL

When a valid image URL is provided, this field will display a thumb image to the right of the message.

Image URL

When a valid image URL is provided, this field will display the image at the bottom of the message. Image will be resized to max width of 400px or a max height of 500px.

Image URL How it will look like in Slack

Allow Slack formatting

When enabled, this field allows you to tag users in the message by enclosing their user ID or user name with < >, e.g. <UA12345> or <@johndoe> for user ID and user name respectively.

Tagging users Tagging users by allowing Slack formatting

Thread ID

Slack threads allow you to group related messages together, making it easier to follow conversations in Slack channels or groups.

To post a message in an existing thread, use the Thread ID datapill in this field. Passing the Message ID of the parent message also works the same way.

Example #1: Passing a parent message's message ID to continue a thread

Notify BD thread configuration The parent message's Message ID is used in the Thread ID input field.

Messages are posted under the same thread via parent message ID Messages are posted under the same thread via parent message ID

Check out this Button action example recipe if you want to explore how thread ID works.

If a thread does not exist yet, but you want to post a message threaded under a parent message, supply the Message ID of the parent message.

Example #2: Passing the message ID to start a thread

Notify BD thread example Thread created and message posted if parent message ID is supplied

Notify BD thread configuration Example use of Message ID used in the Thread ID input field.

Post message as

This field allows you to change the name of who the message is posted by. By default, messages will be posted as Workato [app].

Post message as How it will look like in Slack

Icon image URL

This field allows you to change the icon of who the message is posted by. By default, the Workato icon will be used.

Post message as icon How it will look like in Slack

Respond to button click actions

The Respond to button click action works together with the button click (real-time) trigger to post messages in response to the button click.

Respond to button action example recipe Respond to button action. See the example recipe.

How it works

By passing the Response URL pill from the output of a button click (real-time) trigger, the recipe will know which button has been clicked at run-time.

Similar to the post message action, this action can post messages that just be a simple line of text, or it can include a combination of text, buttons, menus, icons & images — depending on your use case.

Respond to button action configuration Respond to button action configuration

Input

The following are the additional input fields that the Slack action Respond to button has on top of the usual input fields in the Post message action.

Input field Description
Button response URL Obtained from the output datatree of the Slack trigger New button action. This tells the action what button click to respond to.
Response type In channel will post the message like a normal chat message. Ephemeral will post the message visible only to the user who clicked the button.
Replace original If yes, the new message will overwrite the original message with buttons and be posted in the same position in the channel.

If no, the original message with buttons will remain in the same position in the channel. The new message will be added to the end of the channel conversation.

Delete original If yes, the original message with buttons will be removed from the channel. The new message will be added to the end of the channel conversation.

If no, the original message with buttons will remain in the same position in the channel. The new message will be added to the end of the channel conversation.

Invite user to channel actions

The Invite user to channel action invites a user to a public channel. To invite users to multiparty direct messages or private channels, use the Invite user to group action.

Input fields

User

You can use either the user ID/name or user ID datapill. Prefix user names with ‘@’, e.g. @johndoe. However, use user IDs and user ID datapills as-is, e.g. UA12345 or ID, without prefixing them with '@'.

To select available users, switch to 'Select user'. select-user

Channel

You can use either the channel ID/name or channel ID datapill. Prefix channel names with ‘#’, e.g. #general. However, use channel IDs and channel datapills as-is, e.g. CANUXC4MU or ID, without prefixing them with '#'.

To select available channels, switch to ‘Select channel’. select-channel

Invite user to group actions

The Invite user to group action invites a user to multiparty direct message group or private channels. To invite users to a public channel, use the Invite user to channel action.

Input fields

User

You can use either the user ID/name or user ID datapill. Prefix user names with ‘@’, e.g. @johndoe. However, use user IDs and user ID datapills as-is, e.g. UA12345 or ID, without prefixing them with '@'.

To select available users, switch to 'Select user'. select-user Switching to 'Select user'

Group

You can use either the group ID/name or group ID datapill. Prefix group names with ‘#’, e.g. #general. However, use group IDs and channel datapills as-is, e.g. GCNUXC4MU or ID, without prefixing them with '#'.

To select available groups, switch to ‘Select group'. select-channel Switching to 'Select group'

Archive channel actions

The Archive channel action allows you to archive public channels only. Note that the #general channel of a Slack workspace cannot be archived.

Input fields

Channel

You can use either the channel ID/name or channel ID datapill. Prefix channel names with ‘#’, e.g. #general. However, use channel IDs and channel datapills as-is, e.g. CANUXC4MU or ID, without prefixing them with '#'.

To select available channels, switch to ‘Select channel’. select-channel Switching to 'Select channel'

Unarchive channel actions

The Unarchive channel action allows you to unarchive a public channels only.

Input fields

Channel

You can use either the channel ID/name or channel ID datapill. Prefix channel names with ‘#’, e.g. #general. However, use channel IDs and channel datapills as-is, e.g. CANUXC4MU or ID, without prefixing them with '#'.

To select available channels, switch to ‘Select channel’. select-channel Switching to 'Select channel'

Create channel actions

The Create channel action creates a channel with a specified channel name. You can also create private channels. Names will be converted to lowercase, while the following characters will be replaced accordingly:

  • spaces replaced with hyphens,
  • periods replaced with underscores.

For example, the channel name SUPPORT.ticket 101 will be converted to support_ticket-101. Names must also be shorter than 22 characters.

Input fields

Private channel?

Set to 'Yes' to create a private channel. Defaults to 'No'.

Return channel details if already exists?

By default, if a channel already exists, action will return an error. Set this input to 'Yes' if to prevent this — action will return the existing channel's details instead.

Set channel purpose actions

The Set channel purpose action allows you to set the channel purpose of public channels only.

Input fields

Channel

You can use either the channel ID/name or channel ID datapill. Prefix channel names with ‘#’, e.g. #general. However, use channel IDs and channel datapills as-is, e.g. CANUXC4MU or ID, without prefixing them with '#'.

To select available channels, switch to ‘Select channel’. select-channel Switching to 'Select channel'

Channel purpose

Set the channel's purpose. Slack formatting works in this field, including tagging of users. For example:

Input

  • "Hi \<@johndoe>, how ~you~ *doing*?"

Output

  • Hi @johndoe, how you doing?

Learn more about Slack's message formatting in their documentation.

Set channel topic actions

The Set channel topic action allows you to set the topic of public channels only. Slack formatting works in this field, including tagging of users. For example:

Input

  • "Hi \<@johndoe>, how ~you~ *doing*?"

Output

  • Hi @johndoe, how you doing?

Learn more about Slack's message formatting in their documentation.

Input fields

Channel

You can use either the channel ID/name or channel ID datapill. Prefix channel names with ‘#’, e.g. #general. However, use channel IDs and channel datapills as-is, e.g. CANUXC4MU or ID, without prefixing them with '#'.

To select available channels, switch to ‘Select channel’. select-channel Switching to 'Select channel'

Channel topic

Set the channel's purpose. The maximum limit of this field is 250 characters. Slack formatting works in this field, including tagging of users. For example:

Input

  • "Hi \<@johndoe>, how ~you~ *doing*?"

Output

  • Hi @johndoe, how you doing?

Learn more about Slack's message formatting in their documentation.

results matching ""

    No results matching ""