Skip to content

Use cases

Schedule a webhook to fire on a recurring cadence

Plenty of services accept an incoming webhook: Slack, Discord, a CI pipeline, your own app. Cronhost can POST to any of them on whatever schedule you set, so a webhook that should fire every morning or every Monday just fires, without you running a server to do it.

The problem

You have a webhook URL and a cadence in mind, but nothing to pull the trigger on time. Wiring up a cron server or a serverless function just to send one HTTP request is more moving parts than the job deserves.

How to set it up

  1. 1

    Point a schedule at the webhook URL

    Create a schedule with the webhook as its endpoint, set the method to POST, and add the JSON body the receiving service expects. Pick the cron expression and timezone for when it should fire.

    const report = await cronhost.createSchedule({ name: "Weekly report", cronExpression: "0 9 * * 1", // Mondays at 9am timezone: "America/New_York", endpoint: "https://hooks.slack.com/services/...", httpMethod: "POST", body: JSON.stringify({ text: "Weekly report is ready." }), });
  2. 2

    Add headers if the receiver needs them

    If the webhook expects a content type or a signing/auth header, set them per schedule. Cronhost sends them with every request exactly as configured.

  3. 3

    Let retries handle the flaky moments

    Set a retry count so a transient 5xx or a timeout on the receiving end does not drop the delivery. Cronhost retries with exponential backoff, and only the first attempt counts toward your monthly quota.

Example cadence: Run a cron job every Monday at 9 AM

Fire your webhook on schedule

Point Cronhost at any webhook URL and let it POST on time, with retries.

Frequently asked questions