Skip to main content
Run the same agent step over a list, CSV, or text file — then aggregate results in one workflow.
The user supplies a list of items; the workflow loops the agent over each entry then summarises results.

Quick Start

1

Simple Usage

Loop an agent over a variable list:
2

With Configuration

Process rows from a CSV file with a custom handler:

How It Works

Loop outputs are stored in result["variables"]["loop_outputs"] by default.

Common Patterns

CSV customer support

Line-by-line URL analysis

Parallel batch processing


Best Practices

Check that CSV files exist and have headers. Empty files produce zero iterations silently.
When sub-steps do not depend on each other, set parallel=True and cap workers with max_workers.
Add a summariser agent after the loop step rather than embedding aggregation inside each iteration.
Pass row data via ctx.variables["item"] and return a StepResult — avoid side effects outside the workflow context.

Workflow Loop

Loop patterns inside multi-step workflows

Workflow Parallel Execution

Run independent workflow branches concurrently