Retries

Hot supports automatic retries for:

  • Event handlers (meta {on-event: "...", retry: ...})
  • Scheduled functions (meta {schedule: "...", retry: ...})
  • Code tasks (::hot::task/start with ::hot::task/TaskOptions({retry: ...}))

Retries for event handlers and scheduled functions are configured with the retry metadata field; code tasks pass the same retry shape inside TaskOptions.

retry does not apply to synchronous request/response surfaces like MCP tool calls and webhook invocations.

Retry Metadata

The retry field supports two forms.

Simple form:

retry: 3

Full form:

retry: {
  attempts: 5,
  delay: 5000,
  backoff: "exponential",
  max_delay: 120000,
  jitter: true
}
FieldDescriptionDefault
attempts (or simple number)Maximum retry attempts0 (disabled)
delayBase delay between retries (ms)1000
backoffDelay strategy: "fixed", "exponential", "linear""fixed"
max_delayDelay cap for backoff strategies (ms); note snake_case (max_delay)300000
jitterAdd random jitter (about +/-10%)false

Backoff formulas (attempt is 0-indexed, so 0 is the first retry):

  • "fixed": delay
  • "exponential": delay * 2^attempt
  • "linear": delay * (attempt + 1)

How Retries Execute

When a retryable run fails:

  1. Hot reads retry config from the metadata of the function that ran.
  2. If attempts remain, the run is updated to pending_retry.
  3. A new run of the same function is scheduled at next_retry_at.
  4. The retry run is linked to the original via origin_run_id.
  5. Retries stop on success or when attempts are exhausted.

Each handler of an event retries on its own. When several handlers share an event, one with retry retries on its own policy, one without isn't retried, and a retry runs only the handler that failed.

An event a run sends is a new event, so its handlers start at attempt 0 with their own retry, whichever attempt sent it.

In Hot App, retries are shown with retry badges (for example ↻1, ↻2) and linked run history.

Limits and Clamping

Retry values are clamped to configured platform limits:

SettingConfig KeyEnvironment VariableDefault
Max attemptshot.retry.max-attemptsHOT_RETRY_MAX_ATTEMPTS10
Max delayhot.retry.max-delay-msHOT_RETRY_MAX_DELAY_MS3600000 (1 hour)
Default delayhot.retry.default-delay-msHOT_RETRY_DEFAULT_DELAY_MS1000

Delays below the 100ms minimum floor are raised to 100ms, and values above configured limits are capped.