Function: http.default_retry_predicate

Simple default retry predicate for idempotent targets.

If your target is non-idempotent, usedefault_retry_predicate_non_idempotentinstead.

Retries on429 (Too Many Requests),502 (Bad Gateway),503 (Service unavailable), and504 (Gateway Timeout), as well as on anyConnectionError,ConnectionFailedError, andTimeoutError.

For more information, seeRetry steps.

Arguments

Arguments
exceptionThe error to apply the retry criterion upon.

Returns

true when the retry criterion is satisfied,false otherwise.

Examples

# Make an HTTP request using a standard retry predicate# and custom maximum retries and backoff parameters-read_item:try:call:http.getargs:url:https://example.com/someapiresult:api_responseretry:predicate:${http.default_retry_predicate}max_retries:5backoff:initial_delay:2max_delay:60multiplier:2

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.