Action that adds rate limiting to any API endpoint

Example

// Rate limit API calls
await runAction({
ActionName: 'API Rate Limiter',
Params: [{
Name: 'URL',
Value: 'https://api.example.com/data'
}, {
Name: 'Method',
Value: 'GET'
}, {
Name: 'RateLimitKey',
Value: 'example-api'
}, {
Name: 'MaxRequestsPerMinute',
Value: 60
}, {
Name: 'MaxConcurrent',
Value: 5
}]
});

// With authentication and retry
await runAction({
ActionName: 'API Rate Limiter',
Params: [{
Name: 'URL',
Value: 'https://api.example.com/users'
}, {
Name: 'Headers',
Value: { 'Authorization': 'Bearer token' }
}, {
Name: 'RateLimitKey',
Value: 'example-api'
}, {
Name: 'RetryOnRateLimit',
Value: true
}, {
Name: 'BackoffMs',
Value: 1000
}]
});

Hierarchy (view full)

Constructors

Methods

  • Execute API request with rate limiting

    Parameters

    • params: RunActionParams<any>

      The action parameters containing:

      • URL: API endpoint URL (required)
      • Method: HTTP method (default: GET)
      • Headers: Request headers
      • Body: Request body
      • RateLimitKey: Unique key for rate limiter instance (required)
      • MaxRequestsPerMinute: Max requests per minute (default: 60)
      • MaxConcurrent: Max concurrent requests (default: 5)
      • RetryOnRateLimit: Retry on 429 errors (default: true)
      • BackoffMs: Initial backoff in ms (default: 1000)
      • MaxRetries: Max retry attempts (default: 3)
      • Timeout: Request timeout in ms (default: 30000)

    Returns Promise<ActionResultSimple>

    API response with rate limit info

  • 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