← Back to Explore

for-break-on-fail

FAIL BREAK exits the loop early when a substep fails.

for-loops

Rundown


# FOR Break On Fail

## 1. Check items

- FOR item IN 1 TO 3
- FAIL ANY: CONTINUE

### 1.1 Validate {{item}}

- PASS: CONTINUE
- FAIL: BREAK

```bash
rd echo "item={{item}}"
```

## 2. Cleanup

- PASS: COMPLETE

```bash
rd echo "done"
```

Run

Second iteration fails and breaks to step 2

Initializing...

Initializing...

Step/