Documentation Index
Fetch the complete documentation index at: https://ai.aidalinfo.fr/llms.txt
Use this file to discover all available pages before exploring further.
createWhileStep encapsulates a controlled loop: you provide a condition, a mandatory maxIterations, and the step to repeat. The loop chains executions, feeds the previous output as the next input, and collects results.
Polling example
{ lastResult, allResults }, with lastResult potentially undefined when no iteration ran. maxIterations is required and throws a WorkflowExecutionError when the condition would otherwise continue.
Condition & safeguards
condition({ input, lastOutput, iteration, context, signal })is evaluated before each iteration. Returnfalseto exit gracefully.maxIterationsprevents infinite loops; an explicit error is raised when the limit is reached.- The
AbortSignalpropagates automatically—WorkflowAbortErroris thrown on external cancellation.
Prepare input & collect results
prepareNextInputis optional. Without it, the initial input is passed to the first iteration, then each output becomes the next input.collectreceives{ input, results, lastResult, iterations, context }so you can shape the output (aggregation, domain-specific mapping). Withoutcollect,{ lastResult, allResults }is returned.
ForEach or While?
createForEachStepiterates over a known collection and can parallelise (concurrency).createWhileStepshines when the number of iterations is unknown (polling, refinement loops, validations).- Combine the two for advanced pipelines (for example a
whilethat monitors a queue, then aforEachthat processes available items).
Conditional branches.