# Slack

## Overview <a href="#overview" id="overview"></a>

One of the most common workflow integrations is the connection to user's communication suite. Slack is arguably the most popular communication tool.

This integration is a path forward for users who want to connect to their Slack workspace with the Fylamynt platform to interact with workflows, get execution statuses, approvals etc.

## Use Cases <a href="#use-cases" id="use-cases"></a>

The integration between Fylamynt and Slack lets you:

* Send notifications, message from Fylamynt workflows to Slack.
* Manage Fylamynt workflow approvals via direct messages to the Slack Team.

## Configure Slack in Fylamynt <a href="#configure-slack-in-fylamynt" id="configure-slack-in-fylamynt"></a>

* Navigate to **Settings** > **Integrations** > **Slack**.
* Configure a new integration instance.
* In **Slack Integration** page(Fylamynt), click “Add to Slack” button.
* You may be prompted to log into your Slack workspace. If not, verify that you are logged into the Slack workspace that you want to add Fylamynt to.
* Review the permissions required to install **Fylamynt** and click **"Allow"**.
* If installation is successful, you will be redirected back to the **Slack Integration** settings page of your Fylamynt instance.
* After installation, invite **"@Fylamynt"** Slack bot user to the Slack channel(s) where you would like to receive messages on.

## Interaction Actions

You can add these actions in the Fylamynt workflow builder, as part of your workflow.

1. [Approval](#approval)
2. [Slack Add Users](#slack-add-users)
3. [Slack Archive Channel](#slack-archive-channel)
4. [Slack Create New Channel](#slack-create-new-channel)
5. [Slack Send Message](#slack-send-message)

### Approval

Approve or Deny any request to continue the execution of a workflow.

**Input**

| **Parameter**      | **Description**                                                                                                             | **Required** |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- | ------------ |
| alias              | The target account for the run                                                                                              | True         |
| Slack Channel      | Select the Slack channel to notify for approval                                                                             | True         |
| Notes for Reviewer | This notes will be attached to the Slack message that request the approval. This message should give the user more context. | True         |
| Timeout Interval   | Specify an interval before timing out the request. The maximum timeout is 7 days.                                           | True         |

**Output**

| **Parameter**        | **Type** | **Description**                                                                                   |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------- |
| alias                | String   | The target account for the run                                                                    |
| Execution Start Time | String   | A string representation of time when the execution started. i.e *Wed 12 May 2021 22:52:46.441000* |
| Message Channel ID   | String   | The ID of the Slack channel where the message was sent.                                           |
| Message Timestamp    | String   | Timestamp of the Slack message that was sent for approval.                                        |
| Workflow Name        | String   | Name of the workflow associated with the execution.                                               |

**Action Example**

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXYvxfYq9m2JdKqaCdk%2F-MaawpD-Q213DWEVZNDf%2F-MaaxW_Et3k2jmrRkrGK%2Fimage.png?alt=media\&token=feea5c39-5e44-4632-8fc3-9f9f58b783ff)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXYvxfYq9m2JdKqaCdk%2F-MaawpD-Q213DWEVZNDf%2F-MaaxZN_5pAuCo0qXEJa%2Fimage.png?alt=media\&token=13838372-5fd3-442d-ace8-d0604b7cadf2)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXYvxfYq9m2JdKqaCdk%2F-MaawpD-Q213DWEVZNDf%2F-MaaxalPmEunwi24yMKm%2Fimage.png?alt=media\&token=1bb32b37-b1e1-4561-9895-be97037ee031)

### Slack Add Users

Add users to a previously created Slack channel.

**Input**

| Parameter    | Description                                               | Required |
| ------------ | --------------------------------------------------------- | -------- |
| Channel Name | The name of the channel to add the users.                 | True     |
| Users        | Dropdown list of Slack users to add to the above channel. | True     |

**Output**

| Parameter | Type   | Description                                                  |
| --------- | ------ | ------------------------------------------------------------ |
| message   | String | List of the Slack User IDs of the users added to the channel |

**Action Example**

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2F6lMm339BTzWhDqqKkaxn%2Fslack_add_users_workflow.png?alt=media\&token=26e8543d-072a-4898-8daf-64f792aed56b)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FBFlAqcSRVddIrDM1LRRE%2Fslack_add_users_output.png?alt=media\&token=50db2e37-75ee-4fef-94d1-faf9f04660b1)

### Slack Archive Channel

Archives a specified Slack channel. Archived channels can still be searched, but are closed to any new activity.

**Input**

| Parameter    | Description                         | Required |
| ------------ | ----------------------------------- | -------- |
| Channel Name | The name of the channel to archive. | True     |

**Output**

| Parameter | Type   | Description                    |
| --------- | ------ | ------------------------------ |
| message   | String | Status of the archive command. |

**Action Example**

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FW4mFjM2HWrjspTnDJhRQ%2Farchive_channel_workflow.png?alt=media\&token=1809a01d-2d7c-4ea0-9486-eade4a110322)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FU5TdWgUlIxClMsBDN2fB%2Farchive_channel_output.png?alt=media\&token=08b3863b-9bae-4582-905e-c271c57d516c)

### Slack Create New Channel

Create a new slack channel. *Note*:The Fylamynt Slack bot user will be automatically added to any channel created using this action, public or private. This allows the other Slack actions to see the channel.

**Input**

| Parameter    | Description                  | Required |
| ------------ | ---------------------------- | -------- |
| Channel Name | The name for the new channel | True     |
| Private      | Make the new channel private | False    |

**Output**

| Parameter    | Type   | Description                                                                                                                                                                                                                                               |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| channel      | Object | <p>The output of the Slack <a href="https://api.slack.com/methods/conversations.create">conversations.create</a> api call.<br>Channel names may only contain lowercase letters, numbers, hyphens, and underscores, and must be 80 characters or less.</p> |
| channel\_url | String | A URL for the newly created channel                                                                                                                                                                                                                       |

**Action Example**

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FXGxU3KcKwhTUwal4TkbV%2Fslack_create_new_channel_workflow.png?alt=media\&token=5041ad59-c8d6-436a-8844-f7d4a98996ff)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FmhDNCSvfbKguGtLu075O%2Fslack_create_channel_run.png?alt=media\&token=d9970e48-3bd8-425d-99ac-9400b7236bdd)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2F2OpHUoXGnAdRceGi2POk%2Fslack_create_channel_outputs.png?alt=media\&token=ff48e1a9-4fd6-48b7-9fdb-9d2c8eeda807)

### Slack Send Message

Send Slack messages to a given channel.

**Input**

<table data-header-hidden><thead><tr><th>Parameter</th><th width="399.3333333333333">Description</th><th>Required</th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Description</strong></td><td><strong>Required</strong></td></tr><tr><td>Slack Channel</td><td>Name of the Slack channel where we need to send the Slack message</td><td>True</td></tr><tr><td>Message Text</td><td>The message to be sent to the channel.</td><td>True</td></tr></tbody></table>

**Output**

There is no output of this action.

**Action Example**

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXYvxfYq9m2JdKqaCdk%2F-MaawpD-Q213DWEVZNDf%2F-MaaxS6dPuF54ZAxvlDP%2Fimage.png?alt=media\&token=874e2b00-abca-4992-8eb8-1db5d3b6398b)

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXYvxfYq9m2JdKqaCdk%2F-MaawpD-Q213DWEVZNDf%2F-MaaxUBb61aXNkAgrr12%2Fimage.png?alt=media\&token=0eebf260-9fd4-41dc-b7da-4942aacca217)
