Skip to main content

Slack Integration

Pro Plan Required

Slack integration is available on the Pro and Enterprise plans. View plans or upgrade now.

The NightOps Slack bot lets your team start and stop collections directly from Slack, receive notifications, and check infrastructure status.

Features

  • Start/Stop Collections — Turn resources on/off from any Slack channel
  • Status Checks — See what's running without leaving Slack
  • Notifications — Get alerts when schedules run or failures occur
  • Approvals — Require approval before starting production resources
  • On-Call Integration — Automatically notify on-call when resources need attention

Installation

Step 1: Connect to Slack

  1. Go to Settings → Integrations in NightOps
  2. Click Add to Slack
  3. Select your Slack workspace
  4. Authorize NightOps to:
    • Send messages to channels
    • Read messages (for commands)
    • Access user profiles (for permissions)
  5. Click Allow

Step 2: Invite Bot to Channel

Invite the NightOps bot to channels where you want to use it:

/invite @NightOps

Or from channel settings: Integrations → Add Apps → NightOps

Step 3: Verify Installation

Test the bot is working:

/nightops status

You should see a status summary of your collections.


Commands

Basic Commands

CommandDescription
/nightops helpShow available commands
/nightops statusShow status of all collections
/nightops listList all collections

Collection Control

CommandDescription
/nightops start <collection>Start a collection
/nightops stop <collection>Stop a collection
/nightops status <collection>Show detailed collection status

Examples

/nightops start staging-api
→ Starting "Staging API" (5 resources)...
→ ✓ Staging API is now running

/nightops stop dev-environment
→ Stopping "Dev Environment" (8 resources)...
→ ✓ Dev Environment is now stopped

/nightops status staging-api
→ Staging API: Running
→ api-server-1 Running m5.large $119.81/mo
→ api-server-2 Running m5.large $119.81/mo
→ worker-1 Running t3.medium $30.37/mo
→ rds-primary Running db.t3.medium $50.00/mo

Interactive Messages

Collection Cards

When you run /nightops status, you get interactive cards:

┌─────────────────────────────────────────┐
│ 🟢 Staging API │
│ 5 resources • $350.36/month │
│ │
│ [Start] [Stop] [View Details] │
└─────────────────────────────────────────┘

Click buttons to take action without typing commands.

Confirmation Dialogs

For stop operations, a confirmation dialog appears:

┌─────────────────────────────────────────┐
│ Stop Staging API? │
│ │
│ This will stop 5 resources: │
│ • api-server-1 │
│ • api-server-2 │
│ • worker-1 │
│ • rds-primary │
│ • cache-cluster │
│ │
│ [Cancel] [Stop Collection] │
└─────────────────────────────────────────┘

Notifications

Configure Notifications

  1. Go to Settings → Integrations → Slack
  2. Under Notifications, configure:
NotificationDescriptionDefault
Schedule startedWhen a schedule starts resourcesChannel
Schedule stoppedWhen a schedule stops resourcesChannel
Action failedWhen a start/stop operation failsChannel + DM
Manual overrideWhen someone manually starts/stopsChannel

Channel Notifications

Set a default channel for notifications:

  1. Go to Settings → Integrations → Slack
  2. Under Default Channel, select the channel
  3. Save

Per-Collection Channels

Send notifications to different channels per collection:

  1. Edit the collection
  2. Under Slack Channel, select the channel
  3. Save

Example:

Staging API     → #staging-ops
QA Environment → #qa-team
Production → #production-alerts

Approval Workflows

Require approval before starting specific collections:

Configure Approvals

  1. Go to Settings → Integrations → Slack → Approvals
  2. Add an approval rule:
    Collection: production-*
    Require approval from: #infrastructure-approvers
    Timeout: 30 minutes
  3. Save

Approval Flow

When someone tries to start a protected collection:

Alice: /nightops start production-api

NightOps:
┌─────────────────────────────────────────┐
│ 🔔 Approval Required │
│ │
│ Alice wants to start Production API │
│ Reason: "Debugging customer issue" │
│ │
│ [Approve] [Deny] │
│ │
│ Expires in 30 minutes │
└─────────────────────────────────────────┘

Bob (approver): [Approve]

NightOps: ✓ Approved by Bob. Starting Production API...

User Linking

Link Slack users to NightOps accounts for permissions:

Automatic Linking

If using SSO with the same email domain, users are linked automatically.

Manual Linking

  1. User runs /nightops link in Slack
  2. User clicks the link to authenticate
  3. Accounts are connected

Check Linked Status

/nightops whoami
→ Linked as: alice@company.com
→ Role: Member
→ Collections: staging-*, qa-*

Channel Permissions

Control which channels can run which commands:

Configure Channel Permissions

  1. Go to Settings → Integrations → Slack → Channels
  2. Add channel rules:
ChannelAllowed CommandsCollections
#dev-teamAlldev-, staging-
#qa-teamstart, stopqa-*
#all-handsstatus only*
#production-opsAll + approvalsproduction-*

Default Permissions

Channels not explicitly configured:

  • Can run status, list, help
  • Cannot run start or stop

Slash Command Reference

/nightops

Main command prefix. All subcommands start with this.

/nightops status [collection]

Show status overview or details for a specific collection.

Options:

  • No argument: Show all collections
  • Collection name: Show detailed status

Examples:

/nightops status
/nightops status staging-api
/nightops status "Staging API" # Quoted for spaces

/nightops start <collection>

Start a collection.

Options:

  • -r, --reason <text>: Add a reason (for audit log)
  • --no-confirm: Skip confirmation dialog

Examples:

/nightops start staging-api
/nightops start staging-api -r "Debugging issue #123"
/nightops start staging-api --no-confirm

/nightops stop <collection>

Stop a collection.

Options:

  • -r, --reason <text>: Add a reason (for audit log)
  • --force: Skip confirmation dialog

Examples:

/nightops stop dev-environment
/nightops stop dev-environment -r "Done for the day"

/nightops list

List all collections you have access to.

Options:

  • --status <status>: Filter by status (running, stopped, mixed)
  • --env <environment>: Filter by environment tag

Examples:

/nightops list
/nightops list --status running
/nightops list --env staging

/nightops schedule

View schedule information.

Examples:

/nightops schedule               # List all schedules
/nightops schedule staging-api # Show schedule for collection

Link your Slack account to NightOps.

/nightops whoami

Show your linked account and permissions.

/nightops help

Show command help.


Troubleshooting

Bot Not Responding

  1. Verify bot is in the channel: /invite @NightOps
  2. Check bot is online in Slack app directory
  3. Verify integration is active in NightOps settings

"Permission Denied"

  1. Check your NightOps account is linked: /nightops whoami
  2. Verify you have access to the collection
  3. Check channel permissions

Notifications Not Working

  1. Verify bot is in the notification channel
  2. Check notification settings are enabled
  3. Verify collection has correct channel configured

Commands Timing Out

  1. Check NightOps service status
  2. Verify cloud provider connectivity
  3. Try again in a few minutes

Security

Permissions

The NightOps Slack app requests minimal permissions:

  • commands: Process slash commands
  • chat:write: Send messages
  • users:read: Map Slack users to NightOps accounts

Data Handling

  • Slack messages are not stored
  • Only command parameters are logged
  • User mapping is stored securely

Audit Trail

All Slack commands are logged:

2024-01-15 10:30  alice@company.com (Slack)  STARTED  staging-api
2024-01-15 09:00 bob@company.com (Slack) STOPPED dev-environment

Best Practices

Channel Organization

#nightops-staging    → Staging operations
#nightops-qa → QA environment
#nightops-alerts → All failure notifications
#production-ops → Production with approvals

Notification Routing

Failures       → #nightops-alerts (for visibility)
Staging ops → #nightops-staging (for context)
Production → #production-ops + PagerDuty

Team Training

  1. Share command reference with team
  2. Demo common workflows
  3. Set up channel permissions appropriately
  4. Configure approval workflows for sensitive resources

Next Steps