Route notifications to the right team
Send production approval requests to the approvers' channel, each team's release updates to its own channel, and failed production releases to on-call, then tune what each person is told in their own inbox.
The situation
Two teams share Wardn. payments owns checkout; platform owns the cluster and the on-call rota. Today every message lands in one channel, #deploys, and three things have gone wrong: approvers scroll past release chatter to find the request that is waiting for them, the payments team never sees their own failed release until someone pastes a link, and on-call learns about a failed production release from a colleague.
You will connect Slack, add three routes that decide which channel an event goes to, and then set what each person is told in their own inbox. The routes are for the organization and are set once; the inbox is personal (Notifications, Slack).
Two systems, on purpose
Slack routes post to channels, by event, environment, team and severity. Your inbox and Settings › Notifications are for you: which of ten kinds of notice you get, by in-app, email or Slack. Incidents, drift, deploy results and integration problems are inbox notices; they are not posted to Slack channels today. Approval requests, bypass requests and release updates are the ones routes post today.
What you need
| Piece | Setting |
|---|---|
| Permission | integration:manage (Owners and Admins), and a server with WARDN_SECRET_MASTER_KEY set. |
| Slack channels | #deploys (C0DEPLOYS, where everything goes today), #prod-approvals (C0APPROVE), #payments-releases (C0PAYMENTS) and #platform-oncall (C0ONCALL). The Wardn bot has been invited to each. Wardn names a channel by its id, not its name: in Slack, open the channel's details and copy the id at the bottom. |
| Teams | payments; you need its id, from GET /teams. |
Settings
Connect Slack
Follow Slack to create the Slack app and connect it, with #deploys as the connection's channel. That channel is the fallback: it gets every event that no route claims.
api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }
api -X PUT "$WARDN_API_URL/api/v1/integrations/slack/connection" \
-d '{"botToken":"xoxb-…","signingSecret":"…","channel":"C0DEPLOYS"}'
PAYMENTS_ID=$(api "$WARDN_API_URL/api/v1/teams" | jq -r '.items[] | select(.name == "payments") | .id')Add the routes
A route has a name, a channel and filters: events, environments (a name or a class such as production), teams (ids) and the least severity. An empty filter matches everything. Severities are fixed by the event: an approval request is warning; a bypass request, a failed release is critical; a paused or held release is warning; everything else is info.
PUT replaces all the routes at once:
api -X PUT "$WARDN_API_URL/api/v1/integrations/slack/routes" -d '{
"items": [
{
"name": "Production approvals",
"channel": "C0APPROVE",
"events": ["approval.requested", "bypass.requested"],
"environments": ["production"],
"teams": [],
"minSeverity": "warning"
},
{
"name": "Payments releases",
"channel": "C0PAYMENTS",
"events": ["release.raised", "release.status_changed"],
"environments": [],
"teams": ["'"$PAYMENTS_ID"'"],
"minSeverity": "info"
},
{
"name": "On-call: production failures",
"channel": "C0ONCALL",
"events": ["release.status_changed"],
"environments": ["production"],
"teams": [],
"minSeverity": "critical"
}
]
}'Why each is written that way:
- Production approvals. Only the two events that ask someone to act, only in production. The events
approval.decidedandapproval.supersededare not listed because Wardn edits the original message in place when a request is decided or replaced, so the button disappears where it was posted. - Payments releases. Every release a payments-owned app is part of. A release is placed by the first deployment in it. A route that names teams skips an event that belongs to no team, so it never guesses.
- On-call.
criticalkeeps it quiet: only a release that failed (not one that merely paused, which is warning), and only in production.
Break-glass restores
A route can also select restore.break_glass (always critical), for a restore past the guardrails. The message is written, but the server's Slack worker does not subscribe to that event yet, so a route for it posts nothing in this version. Add it to the on-call route once it does; until then, tell on-call yourself.
What "every matching route posts" means
Wardn reads the routes in order and posts to every route that matches, once per channel. A failed production release from a payments app matches the second and the third route and is posted to #payments-releases and #platform-oncall, once each, however often the event is retried.
Two rules to keep in mind:
- An event that no route matches goes to the connection's channel,
#deploys. So a bypass request in staging, which matches no route above, still reaches somewhere. - An event that some route matches goes only to the channels of the routes that match.
#deploysstops hearing about production approvals once the first route exists. If you want it to keep hearing everything, add a last route to it with no filters ("channel": "C0DEPLOYS", all lists empty,"minSeverity": "info").
An approval is never dropped by a route; a route can send it elsewhere, and the Open in Wardn link and the approvals inbox always work.
Tune your own inbox
Each person chooses for themselves. Open Settings › Notifications:
Under Channels, keep In-app on. Email and Slack are master switches: a channel that is off carries nothing, whatever you chose per event. Email needs the install's SMTP server and Slack needs the organization's Slack connection; where one is missing, the row says so and its switch is off. See Notifications for what each notice records.
Under Events, choose per kind. A payments lead might want Incident (Sev 1 and 2 on their team's deployments), Deploy failed and Sync drift (production only) in-app, and Deploy succeeded, which is off until chosen, left off.
Choose Save preferences.
The same through the API:
api -X PUT "$WARDN_API_URL/api/v1/me/notification-preferences" -d '{
"channels": {"inApp": true, "email": false, "slack": false},
"digest": "off",
"kinds": [
{"kind": "incident", "inApp": true, "email": false, "slack": false},
{"kind": "deploy-failed", "inApp": true, "email": false, "slack": false},
{"kind": "deploy-success", "inApp": false, "email": false, "slack": false}
]
}'Kinds you leave out keep their defaults. Choosing Slack sends the notice to you as a direct message from the organization's Slack bot, found by your verified email. The organization's routes still post approval and bypass requests and release updates to their channels, separately. A notice records whether its email and direct message were sent, held for a digest or not_delivered.
Check that it worked
Read the routes back, and look at the order:
api "$WARDN_API_URL/api/v1/integrations/slack/routes" | jq '.items[] | {name, channel, events, environments, minSeverity}'Then make each one happen once, on something you can afford:
- Approval. Push a commit to an app whose production deployment needs an approver.
#prod-approvalsgets "Approve" and "Open in Wardn" buttons. Staging approvals go to#deploys. - Release. Raise a release for a payments app.
#payments-releasesgets it, and#deploysdoes not. - Failure. Let a release to production fail (a paused one is only warning and stays out of on-call, which is the point). The failure reaches
#platform-oncalland, for a payments app,#payments-releases. - Integration state. On Settings › Integrations, Slack shows Connected, and its Recent deliveries list what Wardn sent and whether it was delivered (Integration health).
When Slack is down
Messages are sent from the outbox, so they arrive late rather than being lost, and each is posted once. A channel the bot is not in, or a revoked token, is not retried: it is dead-lettered and counted on the Slack card. If a route seems to do nothing, invite the bot to that channel first, then check the card.
Next
Slack
Connect a workspace, approve from a message, and what keeps a click honest.
Notifications
The inbox, the ten kinds and the choices you can make.
Integration health
What the page says when Slack or another provider is not working.
Related: Approvals, Restore safely during an incident.
Restore safely during an incident
Go back to a known-good snapshot on production while a Sev 1 or 2 incident is open, past the restore guardrails with break-glass, and leave a record of who did it, why and for which incident.
Connect an incident source
Connect PagerDuty so its incidents appear in Wardn on the deployments they affect, "Platform on-call" means whoever is on call right now, and rules that count incidents wait when PagerDuty cannot be read.