> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inferable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Request approval from Slack

# Integration with Slack

Inferable provides an integration which supports programatically sending [Approval Requests](/pages/human-in-the-loop) notifications to Slack.

## Installation

Connect your Slack workspace to a Cluster in the [Playground UI](https://app.inferable.ai) by navigating to the Cluster's "Integrations" tab and selecting "Slack".
This will ask you to authorise your Slack workspace with Inferable.

<Note>
  Your Slack workspace can only be connected to one Cluster at a time.
  Connecting another Cluster to the same workspace will replace the existing
  integration.
</Note>

![Slack Connect](https://mintlify.s3.us-west-1.amazonaws.com/inferable/images/integrations/slack-connect.png)

## Approval Request Notifications

Your [Workflows](/pages/workflows) can programatically notify Slack when human approval is required.

The `Interrupt.approval()` function can accept a `notification` object to configure the Slack notification.

```typescript
import { Inferable, Interrupt, approvalRequest } from "inferable";

const inferable = new Inferable({
  apiSecret: process.env.INFERABLE_API_SECRET,
});

const deleteUserWorkflow = inferable.workflows.create({
  name: "deleteUser",
  inputSchema: z.object({
    executionId: z.string(),
    userId: z.string(),
  }),
});

deleteUserWorkflow.version(1).define(async (ctx, input) => {
  if (!ctx.approved) {
    return Interrupt.approval({
      message: `I need your approval to delete the user ${input.userId}. Is this ok?`,
      destination: {
        type: "slack",
        // The email address of the Slack user to notify
        email: "test@example.com",
        // Or Slack user ID
        userId: "U0123456789",
        // Or Slack channel ID
        channelId: "C0123456789",
      },
    });
  }
  //...
});
```
