Description:

ConsumeSlack allows for receiving messages from Slack using Slack's conversations.history API. This allows for consuming message events for a given conversation, such as a Channel. The Processor periodically polls Slack in order to obtain the latest messages. Unfortunately, the Slack API does not provide a mechanism for easily identifying new replies to messages (i.e., new threaded messages), without scanning through the original "parent" messages as well. As a result, the Processor will periodically poll messages within a channel in order to find any new replies. By default, this occurs every 5 minutes, but this can be configured by changing the value of the "Reply Monitor Frequency" property. Additionally, for long-lived channels, polling all messages would be very expensive. As a result, the Processor only polls messages newer than 7 days (by default) for new replies. This can be configured by setting the value of the "Reply Monitor Window" property.

Slack Setup

In order use this Processor, it requires that a Slack App be created and installed in your Slack workspace. An OAuth User or Bot Token must be created for the App, and the token must have the channels:history, groups:history, im:history, or mpim:history User Token Scope. Which scope is necessary depends on the type of conversation to consume from. Please see Slack's documentation for the latest information on how to create an Application and install it into your workspace.

Depending on the Processor's configuration, you may also require additional Scopes. For example, the Channels to consume from may be listed either as a Channel ID or (for public Channels) a Channel Name. However, if a name, such as #general is used, the token must be provided the channels:read scope in order to determine the Channel ID for you. Additionally, if the "Resolve Usernames" property is set to true, the token must have the users:read scope in order to resolve the User ID to a Username.

Rather than requiring the channels:read Scope, you may alternatively supply only Channel IDs for the "Channel" property. To determine the ID of a Channel, navigate to the desired Channel in Slack. Click the name of the Channel at the top of the screen. This provides a popup that provides information about the Channel. Scroll to the bottom of the popup, and you will be shown the Channel ID with the ability to click a button to Copy the ID to your clipboard.

At the time of this writing, the following steps may be used to create a Slack App with the necessary scope of channels:history scope. However, these instructions are subject to change at any time, so it is best to read through Slack's Quickstart Guide.