Action that executes multiple actions in parallel

Example

// Execute multiple actions in parallel
await runAction({
ActionName: 'Parallel Execute',
Params: [{
Name: 'Actions',
Value: [
{
ActionName: 'Web Search',
Params: { Query: 'latest news' }
},
{
ActionName: 'Get Weather',
Params: { Location: 'New York' }
},
{
ActionName: 'Get Stock Price',
Params: { Symbol: 'AAPL' }
}
]
}]
});

// Wait for first result only
await runAction({
ActionName: 'Parallel Execute',
Params: [{
Name: 'Actions',
Value: [api1Action, api2Action, api3Action]
}, {
Name: 'WaitForAll',
Value: false
}]
});

// With timeout and error handling
await runAction({
ActionName: 'Parallel Execute',
Params: [{
Name: 'Actions',
Value: actions
}, {
Name: 'ContinueOnError',
Value: true
}, {
Name: 'Timeout',
Value: 10000
}, {
Name: 'MaxConcurrent',
Value: 5
}]
});

Hierarchy (view full)

Constructors

Methods

  • Executes multiple actions in parallel

    Parameters

    • params: RunActionParams<any>

      The action parameters containing:

      • Actions: Array of action configurations to execute (required)
      • WaitForAll: Boolean - wait for all vs first (default: true)
      • ContinueOnError: Boolean - continue if actions fail (default: false)
      • MaxConcurrent: Max parallel executions (default: unlimited)
      • Timeout: Overall timeout in milliseconds (optional)
      • IncludeContext: Additional context to pass to all actions (optional)

    Returns Promise<ActionResultSimple>

    Array of results or first result based on WaitForAll

  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result