Monitor your cron jobs with heartbeat alerts powered by Cloudflare Workers
Languages: English | 简体中文
CronPulse is a lightweight, serverless cron job monitoring platform that helps you track your scheduled tasks and get notified when they fail to execute. Built on Cloudflare Workers with React frontend, it provides real-time monitoring with Telegram notifications.
- 📊 Real-time Monitoring: Track all your cron jobs from a single dashboard
- 💓 Heartbeat Detection: Jobs send heartbeats to confirm execution
- ⚡ Instant Alerts: Get notified via Telegram when jobs miss their schedule
- 🌍 Edge Deployment: Runs globally on Cloudflare's edge network
- 📈 History Tracking: View recent execution history for each job
- 🎨 Modern UI: Beautiful dark-mode dashboard with real-time updates
- ⚙️ Easy Integration: Simple HTTP endpoint for any cron job
┌─────────────────┐
│ Your Cron Job │
│ curl POST → │
└─────────────────┘
↓
┌─────────────────────────────────┐
│ Cloudflare Worker (Edge API) │
│ • Receive heartbeats │
│ • Store in KV │
│ • Check for missed beats │
└─────────────────────────────────┘
↓ ↓
┌─────────────────┐ ┌──────────────┐
│ Cloudflare KV │ │ Telegram │
│ (Job Data) │ │ (Alerts) │
└─────────────────┘ └──────────────┘
- Node.js 18+ and npm
- Cloudflare account
- Telegram Bot (for alerts)
git clone https://github.com/zprde/CronPulse.git
cd cron-pulse
npm installnpx wrangler kv namespace create "CRONPULSE_KV"
npx wrangler kv namespace create "CRONPULSE_KV" --previewUpdate wrangler.jsonc with the generated namespace IDs.
- Create a bot via @BotFather
- Get your chat ID from @userinfobot
- Set secrets:
npx wrangler secret put TELEGRAM_BOT_TOKEN
# Paste your bot token
npx wrangler secret put TELEGRAM_CHAT_ID
# Paste your chat IDnpx wrangler secret put ADMIN_PASSWORD
# Type your passwordnpm run deploy- Open your deployed CronPulse dashboard
- Click "+ Add Job"
- Fill in:
- Name: e.g., "Database Backup"
- Expected Interval: How often it runs (in seconds)
- Alert Threshold: Grace period before alerting (in seconds)
After creating a job, you'll get a heartbeat URL. Add this to your cron script:
Bash Example:
#!/bin/bash
# Your job logic
/path/to/backup.sh
# Send heartbeat
curl -X POST https://your-worker.workers.dev/api/heartbeat/job-123456Python Example:
import requests
# Your job logic
backup_database()
# Send heartbeat
requests.post('https://your-worker.workers.dev/api/heartbeat/job-123456')Crontab Entry:
0 2 * * * /path/to/your/script.sh# Start dev server (frontend + worker)
npm run devVisit http://localhost:5173 for the dashboard.
cron-pulse/
├── worker/ # Cloudflare Worker (backend)
│ ├── index.ts # Main worker entry
│ ├── types.ts # TypeScript interfaces
│ ├── storage.ts # KV storage layer
│ ├── telegram.ts # Telegram integration
│ └── alertChecker.ts # Alert logic
├── src/ # React frontend
│ ├── components/ # UI components
│ ├── utils/ # API client & formatters
│ └── App.tsx # Main app
└── wrangler.jsonc # Cloudflare config
| Method | Path | Description |
|---|---|---|
POST |
/api/jobs |
Create new job |
GET |
/api/jobs |
List all jobs |
GET |
/api/jobs/:id |
Get job details |
PUT |
/api/jobs/:id |
Update job |
DELETE |
/api/jobs/:id |
Delete job |
POST |
/api/heartbeat/:id |
Send heartbeat |
GET |
/api/alerts |
Get recent alerts |
{
"name": "Database Backup",
"description": "Daily backup of production DB",
"expectedInterval": 86400,
"alertThreshold": 3600,
"tags": ["production", "database"]
}Set via npx wrangler secret put <NAME>:
TELEGRAM_BOT_TOKEN- Telegram bot authentication tokenTELEGRAM_CHAT_ID- Your Telegram chat ID for alertsADMIN_PASSWORD- Admin password for dashboard access
In wrangler.jsonc:
- Heartbeat: Your cron job sends a POST request after execution
- Tracking: CronPulse records the timestamp in Cloudflare KV
- Monitoring: Every 5 minutes, a scheduled job checks all jobs
- Detection: If
time_since_last_ping > (expected_interval + threshold), an alert is triggered - Notification: Alert sent via Telegram with job details and severity
- Warning: 1-2 consecutive misses
- Critical: 3+ consecutive misses
Jobs not showing up?
- Check browser console for API errors
- Verify KV namespace is bound correctly
No Telegram alerts?
- Confirm secrets are set:
npx wrangler secret list - Test bot token with @BotFather
Heartbeat not working?
- Verify URL is accessible from your cron environment
- Check Worker logs:
npx wrangler tail
MIT
Contributions welcome! Please open an issue or PR.
Built with ❤️ using:
{ "vars": { "MAX_HISTORY_RECORDS": 50 // Max ping history per job }, "triggers": { "crons": ["*/5 * * * *"] // Alert check frequency } }