watch_http
Hand off waiting on a long-running job: RunLater polls a public https:// URL (now, then every 5m to 24h) until the response matches until, the deadline passes (at most 7d), or 3 polls in a row fail (408, 425, 429, 5xx, timeout, network). Any other 4xx, or a redirect, ends it at once. Each poll costs one delivery attempt, taken as it runs, not reserved up front: a long watch can use up attempts other tasks are waiting for. The watch is a task: get_task shows its progress under watch, cancel_task stops it, and callback_url receives a signed POST with the result, including the matched value and up to 16 KiB of the last response body. Headers (e.g. an API token) are deleted when it ends. Pass on_match to act without waiting for your next turn: when (and only when) until matches, RunLater sends that one request as an ordinary task, linked by watch.action_task_id and triggered_by. Its attempt (and its callback's) is reserved when the watch is created; a timeout, failure or cancel sends nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | https:// status URL on a public domain name. | |
| body | No | Request body for every poll. Not allowed with GET. | |
| every | Yes | Time between polls, from "5m" to "24h". The first poll is immediate. | |
| until | Yes | When the job is done. path + in: a 2xx JSON response has one of these values at this JSON Pointer, e.g. { "path": "/status", "in": ["succeeded", "failed"] }. status: the response status is one of these, e.g. { "status": [404] } to wait until something is gone. Given both, both must hold. Only the first 64 KiB of a response is read. | |
| method | No | GET | |
| headers | No | Headers to send on every poll, e.g. Authorization. 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. | |
| deadline | Yes | Stop polling after this long, e.g. "6h"; at least one interval, at most "7d". | |
| on_match | No | A request to send once, as soon as the watch matches, e.g. start the smoke tests when a deploy reports SUCCEEDED. It is a task like schedule_http's: signed, retried, shown by get_task, reporting to its own callback_url. It is sent at least once, so the receiver should dedupe on RunLater-Task-Id. Not sent if cancel_task was called while the matching poll was out (watch.action_skipped: "canceled"). Its header values and body are deleted from the watch when it ends. | |
| callback_url | No | https:// URL that receives a signed POST with the watch's final state, or "inbox" for read_inbox. | |
| idempotency_key | No | Repeat a call with the same key and request to get the same watch back. |