Slack Integration

Learn how to integrate with Slack

Setting up your Slack Application

In order to integrate with Slack, you have to create a Slack application for your workspace. Robomotion uses Slack's Real Time Messaging API, so you need to create a classic Slack application.

More details about Slack App (Classic) and Slack App (New) can be found here.

  1. Login to your workspace and go to Create a Slack App (Classic) page.

Give your app a name and select your workspace, then press Create App button.

2. After your app creation, Click the Permissions card on the page.

3. Scroll down to Scopes section and add bot scope to your application.

5. Go to your applications home page by clicking App Home

6. Press Add Legacy Bot User button.

7. Give your app a display name and default username, then press Add

8. Return to OAuth & Permissions page and press Install App to Workspace

9. Press Allow

10. Notice that your bot appears in your workspace. You can check your Slack application.

11. Go to OAuth & Permissions page of your app and copy your Bot User OAuth Access Token. You will use this token in your Robomotion Flows.

12. You are done! ๐ŸŽ‰

Adding your token to your Flow Designer Vault

  1. Open Flow Designer and create/open any Vault that you want to keep your token.

  2. Press New Item and Select API Key / Token

3. You are done! ๐ŸŽ‰

Creating a Flow that talks with your bot

  1. Create the following flow by drag-and-dropping the nodes from the node palette, or by right clicking on the empty board. You can search the nodes by name.

โ€‹

Below is the list of nodes used in this flow:

  • Assistant -> Chat In

  • Programming -> Function

  • Programming -> Debug

  • Assistant ->ย Chat Out

2. Click Chat In node and select the token from your Vault that you will use in this flow

3. Edit function node and add below script

4. Save and Run your flow

5. When you start your flow, if your token is valid, notice the bot's status in your workspace switching to connected.

6. Now go to your Slack application, click to your bot's name and enter a text into the Slack's direct message view. You will see that your response coming from the msg.text field into Chat Out node in your flow is returned.

You can find many usages for a Slack bot in your flow. A very simple example can be adding a Text Translate node between Chat In and Chat Out nodes to create a translator bot.

7. You are done! ๐ŸŽ‰

Creating a Flow that sends notification messages to a channel

  1. Create the following flow by drag-and-dropping the nodes from the node palette, or by right clicking on the empty board. You can search the nodes by name.

Below is the list of nodes used in this flow:

  • Trigger- > Inject

  • Programming -> Function

  • Assistant ->ย Chat Message

2. Click Chat Message node and select the token from your Vault that you will use in this flow

3. Click Chat Message and fill the Input fields as below.

Channel name: The channel you want to send the message

Username: A username that the message will be from

Icon URL: An icon url for this bot user

4. Edit function node and add below script

5. Save and Run your flow

6. Now go to your Slack application and notice the message at the channel you provided

You can find many usages for a Slack bot in your flow. You can send any error message from your flow for monitoring purposes or you can send messages for status updates.

7. You are done! ๐ŸŽ‰