Schedules
Schedules are recurring automated HTTP requests that Hooklistener executes on your behalf. Instead of waiting for external systems to send you webhooks, Schedules let you proactively reach out to APIs, endpoints, or services at regular intervals.
Each Schedule is configured with a cron expression to define when it runs, and can include custom HTTP details like headers, request body, and validation rules to ensure the response meets your expectations.
How Schedules Work
When you create a Schedule, you define:
- Timing: A cron expression that determines when the request should run (e.g., every 5 minutes, daily at midnight, hourly)
- HTTP Request: The target URL, HTTP method (GET, POST, PUT, PATCH, DELETE), headers, body, and timeout
- Validation: Expected HTTP status codes and optional keyword matching in the response body
- Alerts: Whether to receive notifications when the request fails
Hooklistener automatically executes your Schedule at the specified time, validates the response, and tracks the results. If a request fails, the system will retry with exponential backoff to handle temporary issues gracefully.
Use Cases
Schedules are useful for a variety of automation tasks:
- Health Checks: Monitor API availability by pinging endpoints at regular intervals
- Data Synchronization: Trigger periodic data updates or imports from external systems
- Cleanup Tasks: Run maintenance operations on a schedule (daily cleanup, weekly purges)
- Report Generation: Request periodic reports or exports from services
- Webhook Triggers: Send recurring webhooks to external systems that expect regular updates
- Uptime Monitoring: Verify that critical services are responding as expected
Execution Flow
Here's what happens when a Schedule runs:
- Scheduled Time: At the time specified by your cron expression, Hooklistener initiates the HTTP request
- HTTP Execution: The request is sent with your configured method, headers, body, and timeout (1-120 seconds)
- Response Validation: The response status code is checked against your expected codes (default: 200)
- Keyword Matching: If specified, Hooklistener searches the response body for your expected keyword
- Result Recording: The execution result (success or failure) and message are saved
- Next Run Calculation: The next execution time is automatically calculated based on your cron expression
- Retry on Failure: If the request fails, Hooklistener retries with exponential backoff (up to 60 seconds between attempts)
Status Tracking
Each Schedule maintains detailed execution status:
- Last Run: When the schedule last executed
- Last Status: Whether the last execution succeeded or failed
- Last Message: Details about the execution (e.g., "status 200", "unexpected status 500", "missing keyword 'success'")
- Next Run: When the schedule will execute next
You can view this information in the Schedules dashboard to monitor your automated requests.
Failure Scenarios
A Schedule is marked as failed when:
- The HTTP request times out or fails to connect
- The response status code is not in your list of expected codes
- The response body is missing your expected keyword (if configured)
When failures occur, you can review the execution details to understand what went wrong and adjust your Schedule configuration as needed.
Active vs Inactive
Schedules can be toggled between active and inactive states:
- Active: The schedule will execute automatically at the specified times
- Inactive: The schedule is paused and will not execute until reactivated
This is useful when you need to temporarily disable a Schedule without deleting it entirely.