Quick Start
How It Works
| Input source | Parameter | Behaviour |
|---|---|---|
| Variable list | over="topics" | Iterates variables["topics"] |
| CSV file | from_csv="data.csv" | One sub-step per row |
| Text file | from_file="urls.txt" | One sub-step per line |
| Parallel | parallel=True | Runs iterations concurrently |
result["variables"]["loop_outputs"] by default.
Common Patterns
CSV customer support
Line-by-line URL analysis
Parallel batch processing
Best Practices
Validate input files before starting
Validate input files before starting
Check that CSV files exist and have headers. Empty files produce zero iterations silently.
Use parallel=True for independent items
Use parallel=True for independent items
When sub-steps do not depend on each other, set
parallel=True and cap workers with max_workers.Aggregate with a final summariser step
Aggregate with a final summariser step
Add a summariser agent after the loop step rather than embedding aggregation inside each iteration.
Keep loop handlers focused
Keep loop handlers focused
Pass row data via
ctx.variables["item"] and return a StepResult — avoid side effects outside the workflow context.Related
Workflow Loop
Loop patterns inside multi-step workflows
Workflow Parallel Execution
Run independent workflow branches concurrently

