Member Junction
    Preparing search index...

    Action that iterates over collections executing actions for each item

    // Process array of items
    await runAction({
    ActionName: 'Loop',
    Params: [{
    Name: 'Items',
    Value: [
    { name: 'John', email: 'john@example.com' },
    { name: 'Jane', email: 'jane@example.com' }
    ]
    }, {
    Name: 'ItemVariableName',
    Value: 'user'
    }, {
    Name: 'Action',
    Value: {
    ActionName: 'Send Single Message',
    Params: {
    To: '{{user.email}}',
    Subject: 'Welcome {{user.name}}'
    }
    }
    }]
    });

    // Parallel processing with limit
    await runAction({
    ActionName: 'Loop',
    Params: [{
    Name: 'Items',
    Value: fileUrls
    }, {
    Name: 'Parallel',
    Value: true
    }, {
    Name: 'MaxConcurrent',
    Value: 5
    }, {
    Name: 'Action',
    Value: {
    ActionName: 'Web Page Content',
    Params: { URL: '{{item}}' }
    }
    }]
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    AuthorizesCaller: boolean

    True when the action authorizes its caller itself, so a public entry point such as the RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller must hold, or reads and writes only with the caller's own permissions. Leave it false for an action that acts with more authority than its caller, or that reaches data or sends messages the caller chooses but could not otherwise reach.

    The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.

    Methods

    • Iterates over collections executing actions

      Parameters

      • params: RunActionParams

        The action parameters containing:

        • Items: Array to iterate over (required)
        • ItemVariableName: Variable name for current item (default: 'item')
        • IndexVariableName: Variable name for current index (default: 'index')
        • Action: Action configuration to execute per item (required)
        • Parallel: Boolean - run iterations in parallel (default: false)
        • MaxConcurrent: Max parallel executions (default: 10)
        • ContinueOnError: Boolean - continue if an iteration fails (default: false)
        • IncludeContext: Additional context to pass to each action (optional)

      Returns Promise<ActionResultSimple>

      Array of results from each iteration