Skip to main content

Schedule Examples

This page provides practical examples of common Schedule configurations to help you get started quickly.

API Health Checkโ€‹

Monitor your API's availability by pinging it every 5 minutes.

Configuration:

  • Name: API Health Check
  • Cron Expression: */5 * * * * (every 5 minutes)
  • HTTP Method: GET
  • Target URL: https://api.yourapp.com/health
  • Timeout: 10 seconds
  • Expected Status Codes: 200
  • Expected Keyword: "healthy"
  • Alert on Failure: Yes

This schedule will verify your API is responding with HTTP 200 and the response contains the word "healthy". You'll be alerted if either check fails.


Daily Data Syncโ€‹

Trigger a data synchronization process every day at 2 AM UTC.

Configuration:

  • Name: Daily Data Sync
  • Cron Expression: 0 2 * * * (daily at 2:00 AM) or @daily with 2-hour offset
  • HTTP Method: POST
  • Target URL: https://api.yourapp.com/sync/trigger
  • Headers:
    • Authorization: Bearer your-api-token
    • Content-Type: application/json
  • Request Body:
    {
    "sync_type": "full",
    "notify": true
    }
  • Timeout: 30 seconds
  • Expected Status Codes: 200, 202
  • Alert on Failure: Yes

This schedule starts a synchronization job daily, allowing both immediate success (200) or accepted for processing (202).


Hourly Cleanup Taskโ€‹

Run a cleanup operation at the start of every hour.

Configuration:

  • Name: Hourly Cleanup
  • Cron Expression: 0 * * * * or @hourly
  • HTTP Method: DELETE
  • Target URL: https://api.yourapp.com/cleanup/temporary
  • Headers:
    • X-API-Key: your-api-key
  • Timeout: 60 seconds
  • Expected Status Codes: 200, 204
  • Alert on Failure: No

This schedule performs cleanup without alerting on failures, suitable for non-critical maintenance tasks.


Weekly Report Generationโ€‹

Generate and email a weekly report every Monday at 9 AM.

Configuration:

  • Name: Weekly Report
  • Cron Expression: 0 9 * * 1 (Mondays at 9:00 AM)
  • HTTP Method: POST
  • Target URL: https://api.yourapp.com/reports/generate
  • Headers:
    • Authorization: Bearer your-api-token
    • Content-Type: application/json
  • Request Body:
    {
    "report_type": "weekly_summary",
    "format": "pdf",
    "email_to": "[email protected]"
    }
  • Timeout: 120 seconds
  • Expected Status Codes: 200, 201
  • Expected Keyword: "report_generated"
  • Alert on Failure: Yes

This schedule triggers report generation with a longer timeout to accommodate processing time.


Every 30 Minutes Status Checkโ€‹

Check service status twice per hour.

Configuration:

  • Name: Service Status Check
  • Cron Expression: */30 * * * * (every 30 minutes)
  • HTTP Method: GET
  • Target URL: https://status.yourservice.com/api/status
  • Timeout: 15 seconds
  • Expected Status Codes: 200
  • Expected Keyword: "operational"
  • Alert on Failure: Yes

This schedule monitors your service status page to ensure it's reporting as operational.


Database Backup Verificationโ€‹

Verify database backups completed successfully every day at 3 AM.

Configuration:

  • Name: Backup Verification
  • Cron Expression: 0 3 * * * (daily at 3:00 AM)
  • HTTP Method: GET
  • Target URL: https://backup.yourservice.com/api/verify/latest
  • Headers:
    • X-Backup-Token: your-backup-token
  • Timeout: 30 seconds
  • Expected Status Codes: 200
  • Expected Keyword: "backup_valid": true
  • Alert on Failure: Yes

This schedule checks that your latest backup is valid and alerts you if verification fails.


Business Hours Status Updateโ€‹

Update external status during business hours (weekdays 9 AM - 5 PM).

Configuration:

  • Name: Business Hours Status
  • Cron Expression: 0 9-17 * * 1-5 (hourly from 9 AM to 5 PM, Monday-Friday)
  • HTTP Method: PUT
  • Target URL: https://api.statuspage.com/update
  • Headers:
    • Authorization: Bearer status-page-token
    • Content-Type: application/json
  • Request Body:
    {
    "status": "operational",
    "message": "All systems operational"
    }
  • Timeout: 10 seconds
  • Expected Status Codes: 200, 204
  • Alert on Failure: No

This schedule updates your status page only during business hours.


Monthly Invoice Processingโ€‹

Trigger invoice generation on the first day of each month.

Configuration:

  • Name: Monthly Invoices
  • Cron Expression: 0 0 1 * * (midnight on the 1st of each month)
  • HTTP Method: POST
  • Target URL: https://billing.yourapp.com/api/invoices/generate
  • Headers:
    • Authorization: Bearer billing-api-token
    • Content-Type: application/json
  • Request Body:
    {
    "period": "previous_month",
    "send_emails": true
    }
  • Timeout: 90 seconds
  • Expected Status Codes: 200, 201
  • Alert on Failure: Yes

This schedule generates monthly invoices automatically on the first of each month.


Webhook Heartbeatโ€‹

Send a heartbeat webhook to an external monitoring service every minute.

Configuration:

  • Name: External Heartbeat
  • Cron Expression: * * * * * (every minute)
  • HTTP Method: POST
  • Target URL: https://monitoring.example.com/heartbeat
  • Headers:
    • X-Monitor-Key: your-monitor-key
    • Content-Type: application/json
  • Request Body:
    {
    "service": "hooklistener-schedules",
    "timestamp": "auto"
    }
  • Timeout: 5 seconds
  • Expected Status Codes: 200
  • Alert on Failure: No

This schedule keeps an external monitoring service informed that your Hooklistener account is active.


Advanced Cron Patternsโ€‹

Here are some additional cron expression examples:

  • Every 15 minutes: */15 * * * *
  • Every 2 hours: 0 */2 * * *
  • Every weekday at 8 AM: 0 8 * * 1-5
  • Every weekend at noon: 0 12 * * 0,6
  • First and 15th of month: 0 0 1,15 * *
  • Every quarter (Jan, Apr, Jul, Oct): 0 0 1 1,4,7,10 *
  • Every 5 minutes during business hours: */5 9-17 * * 1-5

Tips for Effective Schedulesโ€‹

  1. Use keywords for validation: Don't just check status codesโ€”verify response content contains expected data
  2. Set appropriate timeouts: Match timeout to expected response time (shorter for health checks, longer for processing)
  3. Alert strategically: Enable alerts for critical schedules, disable for informational ones
  4. Test before activating: Create schedules as inactive first to verify configuration
  5. Use descriptive names: Include what the schedule does and how often (e.g., "Daily DB Backup - 3 AM")
  6. Monitor execution history: Regularly check that schedules are running successfully
  7. Consider time zones: Cron expressions use UTCโ€”adjust times accordingly