hen 0.20.2

Run protocol-aware API request collections from the command line or through MCP.
Documentation
---
sidebar_position: 3
title: Request Reliability
description: Poll an eventually consistent workflow with per-attempt timeouts and inherited defaults.
---

Source file:
[examples/request_reliability.hen](https://gitlab.com/ben_goodman/apps/hen/-/blob/main/examples/request_reliability.hen)

## What It Demonstrates

- preamble reliability defaults
- request-level overrides
- dependency-driven follow-up requests
- `poll_until` with a fixed retry interval

## Key Pattern

```hen
timeout = 30s
poll_every = 1s

---

Create export

POST {{ API_ORIGIN }}/echo

~~~json
{
  "jobId": "export-orders-csv",
  "format": "csv",
  "resource": "orders"
}
~~~

^ & status == 200
& body.jobId -> $JOB_ID

---

Wait for export

> requires: Create export
POST {{ API_ORIGIN }}/echo
timeout = 5s
poll_until = 2m
poll_every = 2s
```

## Run It

```bash
hen verify ./examples/request_reliability.hen
hen run ./examples/request_reliability.hen all --non-interactive
```

## What To Notice

- The second request inherits the preamble defaults, then overrides only the values it needs.
- Polling retries after assertion failures or per-attempt timeouts.
- The captured `JOB_ID` keeps the second request tied to the first request’s output.
- The live example uses an echo-backed mock job so the flow stays runnable in CI and local docs.

Related reference: [Reliability](../reference/reliability.md)