Skip to main content
Agents can process lists of items one by one - like handling emails, analyzing files, or transforming data.

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

A Task 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 inputFileTeam 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

Use maxIterations to prevent runaway loops. Default is 1000.
Use continueOnError: true to process all items even if some fail.
Use onIteration callback to show progress for long-running loops.

Workflows

Multi-step workflows

Agent

Create AI agents