Quick Start
1
Simple Usage
2
With Configuration
User Interaction Flow
Configuration Levels
Data Sources
Common Examples
Email Processing
Handle Errors Gracefully
Looping a Task
ATask fans itself out with loopOver (an array) or inputFile (a CSV) — one run per item, all through team.start().
loopOver an array
loopOver names a variable holding an array. Each item binds to loopVar (default "item").
Pass tasks as plain objects.
import { Task } from 'praisonai' is the workflow-step class ({ name, execute }) and does not accept loopOver, loopVar, or inputFile — Team reads those fields directly off the object.loopState reaches onTaskComplete as { name, index, total } for each item.
inputFile fans out a CSV
inputFile reads a CSV and runs one subtask per row, shaped as Question: <col1>\nAnswer: <col2>.
If a task sets both,
inputFile wins over loopOver.API Reference
Loop
Loop class documentation
Best Practices
Set limits for safety
Set limits for safety
Use
maxIterations to prevent runaway loops. Default is 1000.Handle errors gracefully
Handle errors gracefully
Use
continueOnError: true to process all items even if some fail.Track progress
Track progress
Use
onIteration callback to show progress for long-running loops.Related
Workflows
Multi-step workflows
Agent
Create AI agents

