Quick Start
1
Loop a task over a CSV
2
Same task, async entry point
How It Works
The workflow readsinput_file before the run loop begins and expands the loop task into one subtask per row.
Choose the Right Loop
Sync vs Async
Loop pre-expansion runs identically for
workflow.start() and await workflow.astart(). Prior to SDK versions from 2026-07-27 the async path ran the loop task once as an ordinary task and ignored input_file. If you were using async workflows with task_type="loop", upgrade to pick up the fix.Common Patterns
Summarise a list of URLs
Loop then post-process each row
Best Practices
Omit input_file to default to tasks.csv
Omit input_file to default to tasks.csv
When
task_type="loop" and no input_file is set, the workflow reads tasks.csv from the working directory.One row = one string — use JSON for structured fields
One row = one string — use JSON for structured fields
Each row is passed to
{input} as a single string. Put structured data in JSON inside the row and parse it in the agent instructions.Loop subtasks run sequentially by design
Loop subtasks run sequentially by design
Subtasks execute one after another. Use
AgentFlow.parallel when you want fan-out across rows.A single failing row doesn't abort the workflow
A single failing row doesn't abort the workflow
Other rows still run. Check per-subtask
TaskOutput to find which rows failed.Related
Workflow Loop
AgentFlow-level loops over a CSV as a pipeline step
Workflow Repeat
Repeat a step until a condition is met — no file needed

