← Back to Patterns
goto-next-qualified-step
Demonstrates explicitly advancing to the next step instance using GOTO NEXT syntax for step-level navigation
navigation
Source
# GOTO NEXT {N} - Explicit Step Advancement
Demonstrates explicitly advancing to next step instance from anywhere.
## {N}. Main Loop
- PASS: GOTO NEXT
- FAIL: GOTO ErrorHandler
```bash
rd echo --result pass --result fail
```
## ErrorHandler
- PASS: GOTO NEXT {N}
- FAIL: STOP
Handles errors and returns to main loop.
```bash
rd echo --result pass
```
Try It
Error handler fails to recover, runbook stops
Initializing...
Initializing...
Step—/—
ExpectedSTOP
Env idle