Skip to main content

Auto retry for API calls

Many functions automatically retry failed API calls before giving up:

This is useful for transient network errors, rate limiting, and so on.

Auto-retry works for Xurrent and Microsoft Graph accounts, and for all HTTP accounts that are configured with one or more Bearer tokens or OAuth 2.0 client credentials.

Retrying is done according to the following rules:

  • Rate limit
    When the retry-after header is present in the response, retry after the specified delay.
  • GraphQL cost limit
    When the response indicates that the query cost exceeds the remaining budget, retry after the delay specified in the response body.
  • Connection error
    Retry based on error type:
    • ETIMEDOUT (1 retry)
    • ECONNREFUSED / ECONNRESET / ENOTFOUND (5 retries)
    • Other (10 retries)
  • 4xx or 5xx response code
    Most status codes are retried up to 2 times. The following status codes are not retried:
    • 400
    • 401
    • 404
    • 422
    • 505