Skip to main content

Send a Message to Slack

Learn how to use fastn connectors.

Introduction

In this guide, we are going to build a flow that is going to send a message to a Slack channel.

Prerequisites

This flow requires a Slack account with access to a workspace.

Create a new flow

  • To start off, go to the "Flows" page from the navigation menu on the left and add a new Flow.

flow-page

  • Give your flow a name and create it as an API.

flow-creation-menu

Adding a Slack Connector

  • Drag and drop a connector from the right side menu into the flow.

  • Select fastn connectors and search for the Slack connector.

conn-1

  • Choose the "Send Message" API and click on "Next".

conn-2

Setting up the Slack Connector

  • This API requires an authToken, a message to send and the channel id to identify where to send the message.

  • We can skip the authToken for now. Instead we will activate the connector in the next step.

  • Add a message text in the message field.

  • To get the channel id, go to the channel in the Slack Desktop App and click on the channel name at the top to see channel details.

  • Scroll down to the bottom of the channel details to see the channel id in the following format "C#######".

  • Add the channel id in the connector and save the connector.

conn-2

Activating the Slack Connector

  • Go to the "Connectors" page and select fastn connectors.

  • Find the Slack connector and click on the activate button.

conn-2

  • Authorize a connection to the desired Slack account.

conn-2

  • Return to the flow and re-open the Slack connector.

  • Click on the "Disconnected" label next to the Slack icon.

  • Pick "Default" and click connect.

  • The authToken field will be set automatically and will disappear from the form. Save the connector.

conn-2

Testing the Flow

  • Test your flow using the "Debugger" to see the message pop up in your Slack channel.

flow-1

Mission Success

Congratulations on setting up your first connector!