Slack

Introduction

The purpose of this manual is to detail how to configure and integrate Qflow with Slack to allow interaction between both platforms, allowing to send and respond to Slack messages from Qflow.

Slack has the following actions:

Prerequisites

It is necessary to have a Slack account and a workspace created on the platform. This can be done from here.

Application parameter

To establish the connection, it is necessary to have at least one application parameter (see Application Parameters) that allows establishing communication between Qflow and Slack. This parameter can be created from the service task configuration in Qflow. (see Connector Configuration from a Service Task)

To create a Slack application parameter, the following steps are required as detailed below. To establish a connection, it will only be necessary to configure one of them.

Application parameter using OAuth Authentication Token

This type of application parameter requires the following parameter:

  • OAuth Authentication Token: It is an authentication token that allows Qflow to connect to Slack as a Bot, simulating being a user and performing operations on behalf of the application.

To obtain it, the following steps must be followed:

  1. Access the Slack apps section. Here, create a new application by selecting Create New App.

    _images/OAuth1.png

    Fig. 792 Create New App button in the Slack applications section

  2. Select From scratch to specify that the application is being created from scratch.

    _images/OAuth2.png

    Fig. 793 Application creation type selection view in Slack

  3. Enter the application name and select the workspace to which it will belong, then select Create App. In the example in the image below, it shows that the application is called Qflow and belongs to the Company name workspace.

    _images/OAuth3.png

    Fig. 794 Application creation view in Slack

  4. Select the OAuth & Permissions option in the left menu.

    _images/OAuth4.png

    Fig. 795 OAuth & Permissions selected in the Slack application menu

  5. Within OAuth & Permissions, in the Scopes section, select the Add an OAuth Scope option to add a permission to the application.

    _images/OAuth5.png

    Fig. 796 Add an OAuth Scope selected in the Slack application permissions

  6. Add the channels:read and chat:write permissions, which allow reading basic channel information and writing messages in them, respectively.

    _images/OAuth6.png

    Fig. 797 channels:read and chat:write permissions added to the Slack application

  7. Within OAuth & Permissions, in the OAuth Tokens for Your Workspace section, select Install to Workspace

    _images/OAuth7.png

    Fig. 798 Install to Workspace selected in the Slack application authentication

  8. Confirm the installation of the application in the workspace.

    _images/OAuth8.png

    Fig. 799 Allow selected in the Slack application access permissions confirmation

  9. Once the permissions are confirmed, Slack displays the Bot User OAuth Token, which is the authentication token required to configure the application parameter in Qflow. With this, the necessary steps on the Slack API page are completed.

    _images/OAuth9.png

    Fig. 800 Bot User OAuth Token selected in the Slack application authentication

  10. In Qflow Design, add the Bot User OAuth Token to the OAuth Authentication Token parameter

    _images/OAuth10.png

    Fig. 801 OAuth Token added in Qflow

  11. From the Slack chat, it is necessary to add the application to each Slack channel where you want to allow message sending. You must select the Add apps to this channel option in the desired channel.

    _images/OAuth11.png

    Fig. 802 Add apps to this channel selected as an action in the Slack chat

  12. Search for the Qflow application and add it to the selected channel. To do this, select Add.

    _images/OAuth12.png

    Fig. 803 Add selected in the window to add applications to a Slack channel

Once the steps are completed, it will be possible to send messages from Qflow to Slack using Slack App.

Application parameter using Webhook

This type of application parameter requires the following parameter:

  • Webhook Link: A link that represents a Slack communication channel, allowing Qflow to send messages within this channel.

To obtain it, the following steps must be followed:

  1. Perform steps 1 to 3 of the previous section. (see Application parameter using OAuth Authentication Token)

  2. Select the Incoming Webhooks option.

    _images/Webhook1.png

    Fig. 804 Incoming Webhooks selected in the Slack application add features and functionality menu

  3. Activate the Incoming Webhooks to be able to use them.

    _images/Webhook2.png

    Fig. 805 Activate Incoming Webhooks selected to activate the Webhooks functionality in the Slack application

  4. Once the Incoming Webhooks are activated, select the Add New Webhook to Workspace option. Each webhook created will be associated with a specific Slack channel.

    _images/Webhook3.png

    Fig. 806 Add New Webhook to Workspace selected in the Incoming Webhooks view of the Slack application

  5. Select the channel to associate the webhook with and then select Allow.

    _images/Webhook4.png

    Fig. 807 Allow selected in the channel selection view to associate a webhook in the Slack application

  6. Slack will display the Webhook URL of the webhook created for the selected channel, necessary to configure the application parameter in Qflow. With this, the necessary steps on the Slack API page are completed.

    _images/Webhook5.png

    Fig. 808 Webhook URL displayed in the webhook creation view in the Slack application

  7. In Qflow Design, add the Webhook URL to the Webhook Link parameter

    _images/Webhook6.png

    Fig. 809 Webhook Link added in Qflow

Once the steps are completed, it will be possible to send messages from Qflow to Slack using Webhook.

Actions

The following actions can be performed with Slack:

Send message (Slack App)

This action allows sending a message directly to a Slack channel. The channel name (without the ‘#’) must be provided, followed by the message. If you want to respond to another message, you can also add its identifier. After sending the message, a number is received that identifies the message, allowing to respond to it later.

Table 6 Inputs

Input

Description

Channel name

Required. The name of the Slack channel to which the message is to be sent. (Without ‘#’ at the beginning)

Message

Required. Text of the message to be sent by Slack.

The identifier of the message to which you want to respond.

It is obtained when creating a message from Qflow. If you do not want to respond to a message, this parameter can be left blank.

Table 7 Outputs

Output

Description

Message ID

The number that identifies the message that has just been sent. This number can be used to respond to this message.

Send message (Webhook)

This option allows sending messages to a Slack channel, but in a more limited way. The channel to which you send the message is determined by the Webhook used, as each Webhook is associated with a specific channel. It is not possible to respond to messages directly with this option, as the identifier of the message to which you want to respond cannot be specified.

Table 8 Inputs

Input

Description

Message

Required. Text of the message to be sent by Slack.