← Back to Explore

for-substep-continue-defer

CONTINUE substep followed by DEFER substep within FOR iteration

for-loops

Rundown


# FOR Substep CONTINUE then DEFER

CONTINUE substeps are invisible to iteration aggregation.
Only DEFER substeps feed results into the parent aggregation.

## 1. Process items

- FOR item IN 1 TO 2
- PASS ALL CONTINUE
- FAIL ANY STOP

### 1.1 Validate {{item}}

- PASS CONTINUE
- FAIL CONTINUE

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

### 1.2 Record {{item}}

- PASS DEFER
- FAIL DEFER

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

## 2. Done

- PASS COMPLETE

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

Run

All iterations pass both substeps, DEFER feeds aggregation, CONTINUE is invisible

Initializing...

Initializing...

Step/2