Slack
Integrate Slack with Middleware to deliver alert notifications directly to your team's channels or threads. When OpsAI's automation is enabled, get root cause analysis posted directly in the same thread and ask OpsAI follow-up questions without leaving Slack. You can also start a free-form OpsAI conversation anytime by mentioning @Middleware or sending it a direct message, or ask about a specific alert by mentioning @Middleware under its notification thread.
Prerequisites#
Before connecting Slack, make sure you have:
- A Middleware account with admin access.
- A Slack workspace where you have permission to install apps. Depending on your workspace settings, Slack admin approval may be required.
While integrating Middleware with your workspace, please allow all asked permissions as it is necessary to make OpsAI to provide solution.
Setup#
Follow these steps to connect Slack to your Middleware account:
- Log in to Middleware and go to Integrations → Slack.
- Click the
Install Slackbutton:
- Click Connect Slack and allow the requested permissions in Slack. If your workspace has app approvals enabled, a Slack admin may need to approve the app.

Return to Integrations → Slack in Middleware to verify that the installation shows as Connected.
Tip: To deliver alerts to private channels, the Slack bot must be a member of that channel. After connecting Slack, invite the bot to each private channel where you want to receive alerts (see instructions below).
Configure Alerts to a Slack Channel#
In Middleware, open Alerts → Rules.
Create a new alert rule or edit an existing one.
Go to Aggregation & Medium, choose Slack, and select the channel where you want to receive notifications.

(Optional) Choose “Send in thread” to keep related alerts grouped under a parent message.
Save the rule.
Message Content (what your team will see)#
Middleware includes the essential context responders need to investigate an alert quickly:
- Alert name and severity
- Service / environment / resource (when available)
- Short description and relevant attributes
- Direct link to the alert in Middleware for additional context
(Exact fields depend on the alert type and rule configuration.)
Chat with OpsAI in Slack#
Slack isn't just for receiving alerts — you can talk to OpsAI directly from within it. Depending on where you mention @Middleware, OpsAI knows whether you're starting a brand-new conversation, asking about a plain alert, or following up on an incident, and replies with the right context each time.
There are three ways to interact with OpsAI in Slack:
- Start a General Conversation — mention
@Middlewareanywhere, and ask anything about your infra and data. - Ask about an Alert — ask OpsAI to fix the alert issue directly in the thread by mentioning
@Middleware. - Follow-up on an OpsAI Incident — continue the investigation in the thread where OpsAI posted its root cause analysis by mentioning the
@Middleware.
Start a General Conversation with OpsAI in Slack#
You don't need an alert or incident to talk to OpsAI. Mention @Middleware in any channel, or send it a direct message, and ask anything about your infra and data.
How it works:
Mention
@Middlewarewith your question in any channel where the bot is present — for example,@Middleware why is "Middleware-app-v2" slow today. Or open a direct message with the app and type your question.OpsAI starts a new conversation and replies in the same thread.

Continue the conversation by replying in that thread and mentioning
@Middlewareagain.
By default, general conversations use your account's default project. To route them elsewhere, see below.
Route General Chats to a Project#
General conversations (not tied to a specific alert or incident) route to one project at a time. You can change which project that is whenever you like.
From Middleware:
Go to Integrations → Slack.
Under Route general chats to, choose a project from the dropdown.

From Slack:
Go to Middleware app and write below in DM:
/middleware show projectsto list your account's projects, along with each project's ID and UID./middleware set project <PROJECT ID / UID>to switch, using either value shown in the list.
Alert conversations and incident follow-ups always use the project the alert or incident already belongs to — this setting only affects general conversations.
Ask About a Specific Alert in Slack#
You can also ask OpsAI about an alert notification triggered from your Alert module, without opening Middleware.
How it works:
Under an alert notification triggered from your Alert module, reply in the thread and mention
@Middlewarewith your question — for example,@Middleware what changed right before this fired?.OpsAI starts a conversation scoped to that alert and posts its reply in the same thread.
Continue asking follow-up questions by mentioning
@Middlewareagain in the same thread.
Ask OpsAI Follow-Up Questions in Slack#
When OpsAI investigates an incident and posts its findings (root cause analysis and suggested fix) into a Slack thread, you can continue the investigation directly from Slack without opening Middleware.
How it works:
OpsAI posts its root cause analysis as a threaded reply under the original notification.
Reply in that same thread and mention the app
@Middlewarewith your question - for example,@Middleware can you make a PR to resolve this?While OpsAI investigates, you'll see a native spinner status next to the app's name in the thread.
OpsAI's answer is posted back as a reply in the same thread once it's ready.

Good to know:
- This works inside OpsAI incident threads specifically. For a plain alert notification thread, see Ask About a Specific Alert in Slack; to start a new conversation, see Start a General Conversation with OpsAI in Slack.
- OpsAI responds only when
@Middlewareis explicitly mentioned. It does not read or react to every message in the thread. - If the incident is older than your account's data retention window or there is no longer an active OpsAI investigation associated with the thread, the app will notify you.
- If your account has reached its OpsAI usage limit, you'll receive a message explaining that the request cannot be processed.
To configure the complete workflow, including enabling Auto Investigation for a source, automatically receiving RCA in Slack, and asking follow-up questions, see Auto Investigation in OpsAI Settings.
Private Channels & Inviting the Bot#
Slack only allows apps to post in private channels when the app user (bot) has been explicitly invited.
You can invite the Middleware bot by:
- Typing
/invite @Middlewareinside the private channel. - Going to Channel → Integrations → Add an app and selecting Middleware.
After inviting the bot, return to Middleware and refresh the channel list if the private channel does not appear immediately.
Test Your Connection#
To verify the integration:
- Create a temporary alert rule with a benign condition, or use a test/preview action if available in the Alerts UI.
- Send the alert to a non-critical channel such as
#alerts-sandbox. - Confirm that the Slack message arrives successfully.
- Verify that the link in the alert opens the corresponding alert in Middleware.
Slack Slash Commands#
Use the /middleware slash command from any channel or DM:
| Command | What it does |
|---|---|
/middleware show projects | Lists your account's projects, with their project ID and UID. |
/middleware set project <PROJECT ID / UID> | Sets which project general conversations route to. |
/middleware support | Contact the Middleware support team. |
/middleware docs | Open the Middleware documentation. |
/middleware help | View the list of available commands. |

FAQs#
Does OpsAI reply to every message in the thread?
No. OpsAI only responds when you explicitly mention @Middleware. Other messages in a channel thread are ignored.
Can I ask OpsAI a question in a direct message instead of a channel thread?
Yes. Send the app a direct message and mention @Middleware with your question to start or continue a general conversation. Following up inside an OpsAI incident thread still requires replying in that thread.
What happens if I message the app directly without mentioning it?
Middleware checks your message against its built-in commands (like show projects). If it doesn't match one, you'll see a list of available commands. OpsAI only starts or continues a conversation when you explicitly mention @Middleware.
Can I start a conversation with OpsAI that isn't tied to an alert or incident?
Yes. Mention @Middleware in any channel, or send it a direct message. See Start a General Conversation with OpsAI in Slack.
Can I ask OpsAI about a plain alert, not just an OpsAI incident?
Yes. Reply and mention @Middleware under the alert's notification thread. See Ask About a Specific Alert in Slack.
The spinner indicator disappeared before I got an answer - did my question get lost?
No. Slack may dismiss the indicator if another message is posted in the thread while OpsAI is still working. Your request will continue processing, and OpsAI will post its response when it is ready.
Why isn't OpsAI responding when I mention it?
A few things to check:
- Make sure you used an explicit
@Middlewaremention — the app ignores messages in a channel thread that don't mention it. - The bot must be a member of the channel. Invite it if it isn't (see "Private Channels & Inviting the Bot" below).
- For incident follow-ups specifically, OpsAI auto-investigation must be enabled for the relevant project.
- Your Slack connection may need to be reconnected to grant newer permissions. Check Integrations in Middleware → Slack for a reconnect prompt.

Can multiple people ask OpsAI questions in the same thread?
Yes, but OpsAI processes one question at a time per thread. If another question is sent while the first is still being processed, wait for the first response before sending the next one.
Troubleshooting#
“I can’t see some channels in the picker”
- For private channels, invite the Middleware bot first, then return to the alert rule and refresh the channel list.
“Message not delivered” or bot says not_in_channel
- The bot is not a member of that channel. Invite it with
/invite @<Middleware Bot>and retry.
“Integrations menu is missing” in Middleware
- Your Middleware role may not have the required installation permissions. Ask an administrator to grant the appropriate permission under Settings → Roles.
“We post a lot of alerts—will Slack rate-limit us?”
- Slack applies rate limits to message posting. If you expect a high volume of alerts, consider routing high-volume rules to separate channels, reducing unnecessary alerts, or using threaded replies where appropriate.
“OpsAI isn't replying when I mention it in a thread”
- See the FAQ above: confirm the bot is in the channel, that OpsAI is enabled for the project if this is an incident thread, and that your Slack connection is up to date.
Security & permissions (quick reference)#
Middleware follows a least-privilege approach. Slack displays all requested scopes during installation.
chat:write— Allows Middleware to post messages as the app.channels:read/groups:read— Provides read-only access to the channel list so you can select alert destinations.app_mentions:read— Detects when@Middlewareis explicitly mentioned in a channel.im:history— Reads direct messages sent to the app so it can respond to them.assistant:write— Displays the native status indicator while OpsAI processes a request.
Middleware does not read general channel history or unrelated message content. In channels, the app only processes a message when @Middleware is explicitly mentioned. In direct messages, the app reads your message to check whether it's a recognized command or an explicit @Middleware mention, and does not otherwise act on DM content.
For private channels, the Middleware app must be explicitly invited before it can access or post to the channel.
Need assistance or want to learn more about Middleware? Get in touch with us via our Contact Us or join our Slack channel.