Slack is today’s digital headquarter, where people across the world work collaboratively. Slack is an all-purpose communication platform which includes instant messaging, voice and video calling, and a suite of tools to help groups share information to work together. Slack has standalone applications for Windows, Mac, Android, Linux and iOS.
Integration is the process of enabling independently designed applications to work together by sharing processes and business data among each other. It is one of Slack’s most powerful features. Slack allows easy integration with other apps including Google Drive and Dropbox, to streamline file sharing. It uses a variety of bots to handle other tasks, such as pulling in data from external tools or creating quick surveys. These app integrations make the platform more versatile than other apps dedicated solely to communication. Thus, it saves time by streamlining daily tasks on Slack. The entire team can join video calls, manage their calendars and collaborate on files without switching tabs.
Slack is also designed to work with the internally built solutions and processes. Now users can integrate Slack with other applications to harness more value out of it. Teams can use it for creating workflows and bringing data from any application.
Benefits of Slack Integrations
Integrating Slack with an in-built application can improve communication among the team along, save a lot of time and boost productivity. When your app is connected directly to Slack, instead of logging into the app to complete an action, you can directly do the needful from Slack. There’s no closing down tabs or switching between applications. This feature provided by Slack could be used to:
Integrate your custom app with Slack
Slack allows easy integration of your custom app to send direct messages to the private, public and direct channels of an organization's workspace.
The following steps give an overview of how you can easily send data from your custom application to Slack channels through your Slack App. Here, the application has been designed in the WEM Modeler.
1) First step is to create an app on Slack with the basic instructions provided in the documentations on Slack. The following credentials can be found in the basic information section of the newly created app.
2) Moving to the OAuth Permission section, you can find the user and bot access tokens.
3) Once you have your app credentials, you need to add a redirect URL of the OAuth connection set up in your custom app. You also need to add the scopes you need to provide to your app. These would define the read/write rights for your app for different channels.
4) Once the scopes and redirect URL are added, you need to reinstall the app to your workspace and choose the channel or Slackbot where you wish to post all the messages while interacting with your app.
5) Now, let's connect our WEM flow to the Slack app via n8n, which is a free and open tool to create your own nodes to integrate third‑party services or in-house tools.
6) The following workflow is executed when the webhook is triggered.
The webhook node provides a URL that should be used to set up an HTTP request from the WEM flow.
7) The query field can be set up as the name value pair. The query parameters are received at the webhook node when the WEM flow is initiated. The Set Node in n8n allows the setting of the received parameters from the previous node to the variables, which are sent as input to the Slack Node. The bot access token provided by the Slack App should be added in the credentials field of Slack Node in n8n.
8) The channel name can be specified in the channel field of the Slack node. The text field can be set to the variable whose value was set from the received query parameters of the Http request from the WEM flowchart. When the above flowchart is executed in n8n, it waits for the flow to be triggered. Once the flow is triggered by executing it in WEM, the Slack message is successfully sent to the specified channel in the workspace for which the Slack App was configured.
9) To send a direct message to a particular user in the workspace, we first need to get the user ID of the user. This can be retrieved from the response received from an http request call to lookUpByEmail Slack API via https://Slack.com/api/users.lookupByEmail. The received user ID can be set as the channel on the Slack node in n8n. This way a specified message can be sent to a particular user through direct messaging.
Thus, we can easily integrate our application with the organization’s Slack workspace to benefit from it features, save time and boost productivity.