Member Junction
    Preparing search index...

    Interface MJTaskEntity_ITaskForEachConfiguration

    A ForEach step: run the body once per item in a collection.

    This mirrors ForEachOperation in @memberjunction/ai-core-plus field for field, on purpose. That interface is already the universal loop shape every agent type uses — flow agents convert their stored step configuration into it, loop agents receive it from the model. Defining a second, near-identical shape here is how the two would drift: a field added to one and not the other makes the compile silently lossy, and the loss shows up as a loop that ignores a setting its author set. Keep them identical; if ForEachOperation gains a field, add it here in the same edit.

    interface MJTaskEntity_ITaskForEachConfiguration {
        action?: MJTaskEntity_ITaskLoopActionBody;
        collectionPath: string;
        continueOnError?: boolean;
        delayBetweenIterationsMs?: number;
        executionMode?: "sequential" | "parallel";
        indexVariable?: string;
        itemVariable?: string;
        maxConcurrency?: number;
        maxIterations?: number;
        prompt?: MJTaskEntity_ITaskLoopPromptBody;
        subAgent?: MJTaskEntity_ITaskLoopSubAgentBody;
    }
    Index

    Properties

    Run this action once per iteration.

    collectionPath: string

    Path in the payload to the array to iterate over.

    continueOnError?: boolean

    Keep going if an iteration fails (default: false).

    delayBetweenIterationsMs?: number

    Delay between iterations, in milliseconds (default: 0).

    executionMode?: "sequential" | "parallel"

    One at a time, or several at once (default: 'sequential').

    indexVariable?: string

    Variable name for the loop index (default: "index").

    itemVariable?: string

    Variable name for the current item (default: "item").

    maxConcurrency?: number

    Ceiling on concurrent iterations when executionMode is 'parallel' (default: 10).

    maxIterations?: number

    Maximum iterations (undefined = 1000, 0 = unlimited, >0 = limit).

    A prompt run once per loop iteration.

    Run this sub-agent once per iteration.