Slack

The Slack component is an application component that allows users to get and send message on Slack. It can carry out the following tasks:

#Release Stage

Alpha

#Configuration

The component definition and tasks are defined in the definition.json and tasks.json files respectively.

#Setup

In order to communicate with Slack, the following connection details need to be provided. You may specify them directly in a pipeline recipe as key-value pairs within the component's setup block, or you can create a Connection from the Integration Settings page and reference the whole setup as setup: ${connection.<my-connection-id>}.

FieldField IDTypeNote
Bot OAuth Token (required)bot-tokenstringToken associated to the application bot
User OAuth Tokenuser-tokenstringToken to act on behalf of a Slack user

#Connecting through a Slack App

The Slack component connects with your workspace via a Slack App. In order to read / write messages from / to Slack, you'll need to:

  • Add the app to your workspace.
  • Add the app to the channels you want to interact with.

The Slack integration on Instill Cloud uses OAuth 2.0 to connect with Slack via the instill-ai app. There, creating a connection will simply require authenticating on Slack. Your newly created connection, which you can reference in your pipelines, will allow you to read messages and send them on behalf of your user or the instill-ai bot on the channels where that app is installed.

If you want to connect with Slack via OAuth 2.0 on Instill Core, you will need to provide your app's client ID and client secret as environment variables on Instill Core.

#Supported Tasks

#Read Message

Get the latest message since specific date

InputIDTypeDescription
Task ID (required)taskstringTASK_READ_MESSAGE
Channel Name (required)channel-namestringChannel name, as displayed on Slack
Start to Read Datestart-to-read-datestringDate (in YYYY-MM-DD format) from which messages will start to be fetched. If not provided, it will be 7 days before the current date. The date will be in the UTC timezone.
OutputIDTypeDescription
Conversationsconversationsarray[object]An array of conversations with thread messages
Output Objects in Read Message

Conversations

FieldField IDTypeNote
Last Datelast-datestringDate of the last message
Start Conversation Messagemessagestringmessage to start a conversation
Start Datestart-datestringwhen a conversation starts
Replied messagesthread-reply-messagesarrayreplies in a conversation
User UIDuser-idstringunique id from Slack
User Nameuser-namestringuser name in Slack

Replied Messages

FieldField IDTypeNote
Replied Timedatetimestringreplied datetime
Replied Messagemessagestringmessage to reply a conversation
User UIDuser-idstringunique id from Slack
User Nameuser-namestringuser name in Slack

#Send Message

send message to a specific channel

InputIDTypeDescription
Task ID (required)taskstringTASK_WRITE_MESSAGE
Channel Name (required)channel-namestringChannel name, as displayed on Slack
Message (required)messagestringThe message to be sent to the target channel
Send As Useras-userbooleanSend the message on behalf of the user identified by the setup.user-token field
OutputIDTypeDescription
ResultresultstringResult of the message delivery