Skip to main content
Demonstrates that Loop iterations carry forward the output from the previous iteration. Each iteration receives the previous iteration’s output via step_input.get_last_step_content(), enabling iterative processing patterns like accumulation, refinement, and convergence.
loop_iterative_accumulation.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Run the example

Save the code above as loop_iterative_accumulation.py, then run:
Full source: cookbook/04_workflows/03_loop_execution/loop_iterative_accumulation.py