create_cron
Run an HTTP request on a recurring schedule: a 5-field cron expression in UTC with a single minute value (at most once an hour) (e.g. "0 6 * * *" is daily at 06:00 UTC). Each run is an ordinary task (see get_task) and costs delivery attempts. Dead man's switch: if a run fails, or cannot start because the trial's attempts ran out or it ended, RunLater POSTs a signed alert to alert_url, and again when a run next succeeds. To hear how runs went, pass callback_url (a URL, or "inbox" for read_inbox) and capture: true to keep each run's response; report: "failures" sends only failed runs, so a healthy cron stays quiet (and doesn't wake you via set_wake). A run that cannot start at all (attempts ran out, the trial ended) never reports; it turns the cron failing, which goes to alert_url, so set alert_url too ("inbox" works). Calling again with the same name replaces that cron's schedule and request. At most 10 crons.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | https:// URL on a public domain name. | |
| body | No | Request body for every run. Not allowed with GET. | |
| name | Yes | The cron's name, e.g. "daily-backup". | |
| method | No | POST | |
| report | No | Which runs report to callback_url: every run, or only failed ones. "failures" needs callback_url. | always |
| capture | No | Keep each run's response (status, 4 headers, first 16 KiB), as schedule_http's capture. Untrusted data. | |
| headers | No | Headers to send on every run. Same rules as schedule_http. A header value may use {{secret:NAME}} (see set_secret); RunLater fills it in only when sending, to hosts the secret allows. | |
| schedule | Yes | minute hour day-of-month month day-of-week, in UTC. | |
| alert_url | No | https:// URL that gets a signed POST when the cron starts failing (cron.failing) and when it recovers (cron.recovered). Or "inbox" to get those events from read_inbox instead. | |
| callback_url | No | Where each run reports when it finishes, as schedule_http's callback_url: a signed POST of task.finished to an https:// URL (one extra delivery attempt per report; one is reserved per run), or "inbox" (free). | |
| max_attempts | No | Attempts per run. |