8.8 KiB
n8n + Uptime Kuma Integration Guide
n8n for Beginners: This guide will walk you through setting up smart notifications for your infrastructure monitoring.
What This Does
This n8n workflow receives alerts from Uptime Kuma and routes them intelligently:
- CRITICAL alerts → Email + Discord/Slack (immediate)
- PUBLIC alerts → Discord (after retry threshold)
- INTERNAL/METRICS/UTILITY → Logged only (no spam)
All alerts are logged for debugging and historical tracking.
Step 1: Import Workflow into n8n
1.1 Access n8n
Go to http://10.0.10.22:5678
1.2 Import the Workflow
- Click Workflows (left sidebar)
- Click Add Workflow (top right)
- Click the ⋮ menu (top right) → Import from File
- Select:
C:\Users\Fred\projects\n8n-uptime-kuma-workflow.json - Click Import
1.3 Activate the Workflow
- The workflow editor will open
- Toggle the Active switch (top right) to ON
- You should see "Workflow activated" message
Step 2: Get Your Webhook URL
2.1 Find the Webhook URL
- In the workflow editor, click on the "Webhook - Uptime Kuma" node (first blue node)
- Look for Test URL or Production URL
- Copy the production URL - it should look like:
http://10.0.10.22:5678/webhook/uptime-kuma
Save this URL - you'll need it for Uptime Kuma!
Step 3: Configure Uptime Kuma Notifications
3.1 Create n8n Notification Channel
- Go to Uptime Kuma: http://10.0.10.26:3001
- Click Settings (left sidebar)
- Click Notifications tab
- Click Add New Notification
3.2 Configure Webhook
- Notification Type: Select Webhook
- Friendly Name:
n8n Alert Router - POST URL:
http://10.0.10.22:5678/webhook/uptime-kuma - Content Type:
application/json - Notification Sound: (your preference)
- Click Test to verify
- Click Save
3.3 Assign to Monitors
Now assign this notification to your monitors:
- Go to Dashboard
- Click on a CRITICAL monitor (e.g., "Proxmox - main-pve")
- Click Edit
- Scroll to Notifications
- Select n8n Alert Router
- Apply on: Select When status is DOWN
- Click Save
Repeat for all CRITICAL monitors (you can select multiple monitors and edit in bulk)
Step 4: Enable Notification Channels
By default, all notification nodes are disabled (to prevent errors). Enable the ones you want to use:
Option A: Discord (Recommended for Beginners)
4.1 Create Discord Webhook:
- Open Discord
- Go to your server → Settings → Integrations
- Click Webhooks → New Webhook
- Name it "Uptime Kuma Alerts"
- Select channel (e.g., #monitoring)
- Copy the Webhook URL
4.2 Configure in n8n:
- In the workflow, click "Discord - CRITICAL Alert" node
- Click Parameters
- Paste your Discord webhook URL
- Toggle the node Enabled (remove checkmark from "Disabled")
- Click Save (top right)
Repeat for "Discord - PUBLIC Alert" if you want public service alerts too.
Option B: Email (SMTP)
4.1 Configure in n8n:
- Click "Email - CRITICAL Alert" node
- Click Credentials → Create New
- Choose your email provider:
- Gmail: Use App Password (not your main password)
- Outlook/Office365: Use SMTP settings
- Custom SMTP: Enter your SMTP details
Example: Gmail Setup
- From Email: your-gmail@gmail.com
- To Email: your-alert-email@gmail.com
- SMTP Host: smtp.gmail.com
- SMTP Port: 587
- Username: your-gmail@gmail.com
- Password: (App Password from Google Account settings)
- Secure: TLS
- Click Test to verify
- Click Save
- Enable the node (uncheck "Disabled")
Option C: Slack
4.1 Create Slack App:
- Go to https://api.slack.com/apps
- Click Create New App → From scratch
- Name: "Uptime Kuma"
- Select your workspace
- Go to OAuth & Permissions
- Add Bot Token Scopes:
chat:write,chat:write.public - Click Install to Workspace
- Copy the Bot User OAuth Token
4.2 Configure in n8n:
- Click "Slack - CRITICAL Alert" node
- Click Credentials → Create New
- Paste your Bot Token
- Click Save
- Enable the node
Step 5: Test Your Setup
5.1 Trigger a Test Alert
Let's test with a non-critical monitor:
- Go to Uptime Kuma
- Find "[UTILITY] CA Server" monitor
- Click Edit
- Temporarily change port from
8443to9999(invalid port) - Click Save
- Wait 30-60 seconds for the monitor to check
5.2 Check n8n Execution
- Go to n8n: http://10.0.10.22:5678
- Click Executions (left sidebar)
- You should see a new execution
- Click it to view details
5.3 Verify Alert Received
- Discord: Check your #monitoring channel
- Email: Check your inbox
- Slack: Check your channel
5.4 Fix the Monitor
- Go back to Uptime Kuma
- Edit the CA Server monitor
- Change port back to
8443 - Save
Workflow Overview
Here's what happens when a monitor goes down:
Uptime Kuma Alert
↓
n8n Webhook Receives
↓
Format Alert Data
(Parses monitor info, status, error)
↓
┌──────────────┬──────────────┐
↓ ↓ ↓
Is CRITICAL? Is PUBLIC? Log All
↓ ↓ Alerts
↓ ↓
Email + Discord
Discord + (Optional)
Slack
(Optional)
Smart Routing:
- CRITICAL monitors (VPS, Proxmox, PostgreSQL) → Immediate multi-channel alerts
- PUBLIC monitors (websites) → Discord only
- Everything else → Logged for review
Customization Ideas
Add SMS Alerts (via Twilio)
- Add Twilio node after "Is CRITICAL?"
- Configure with your Twilio account
- Send SMS for CRITICAL alerts only
Add Phone Call Alerts
- Use Twilio or VoIP.ms node
- Trigger phone calls for critical infrastructure failures
- Only for CRITICAL monitors to avoid spam
Create Alert Batching
- Add Wait node before Discord/Email
- Collect multiple alerts for 5 minutes
- Send one consolidated message
Add Status Page Integration
- After "Format Alert Data", add HTTP Request node
- POST to your status page API
- Auto-update public status page
Store Alerts in Database
- Add PostgreSQL node (connect to 10.0.10.20)
- Create
alertstable - Log all alerts for historical analysis
Troubleshooting
Webhook Not Receiving Data
- Check workflow is Active (toggle at top right)
- Verify webhook URL is correct in Uptime Kuma
- Check n8n executions for errors
Discord/Email Not Sending
- Make sure node is Enabled (not grayed out)
- Check credentials are configured
- Look at n8n execution details for error messages
Too Many Alerts
- Increase retry counts in Uptime Kuma monitors
- Change "Apply on" to only DOWN (not also UP)
- Add filtering logic in n8n (only alert after X failures)
Not Enough Alerts
- Check monitor has notification assigned
- Verify "Apply on" includes DOWN status
- Check n8n workflow is active
Advanced: Alert Suppression (Prevent Spam)
Add this after "Format Alert Data" to suppress duplicate alerts:
- Add Function node
- Code:
// Suppress duplicate alerts within 15 minutes
const alertKey = `${$json.fullName}-${$json.status}`;
const lastAlert = $workflow.staticData[alertKey] || 0;
const now = Date.now();
if (now - lastAlert < 15 * 60 * 1000) {
// Alert sent less than 15 min ago - suppress
return [];
}
// Send alert and remember timestamp
$workflow.staticData[alertKey] = now;
return [$input.item];
This prevents getting the same alert repeatedly.
Next Steps
- ✅ Import workflow into n8n
- ✅ Activate workflow and get webhook URL
- ✅ Configure Uptime Kuma notification
- ✅ Enable Discord/Email/Slack notifications
- ✅ Test with a non-critical monitor
- ✅ Assign notifications to all CRITICAL monitors
- ⏸️ Customize alert routing (optional)
- ⏸️ Add SMS/phone call alerts (optional)
- ⏸️ Create alert dashboard in Grafana (optional)
n8n Dashboard: http://10.0.10.22:5678
Uptime Kuma: http://10.0.10.26:3001
Workflow File: C:\Users\Fred\projects\n8n-uptime-kuma-workflow.json
Pro Tip: Once you're comfortable with n8n, you can create workflows for:
- Auto-restarting failed services
- Creating GitHub issues when monitors fail
- Sending daily/weekly uptime reports
- Integration with your homelab automation
Welcome to n8n! 🎉