Skip to main content

WaitTimeFromResponse

Compute the wait time, in relative seconds, from the JSON response body or the response headers. A non-JSON body is exposed as an empty response. If the expression evaluates to an empty, zero, negative or non-numeric result, or cannot be evaluated on the response, the next backoff strategy is used.

  • type: object
  • required: ["type","wait_time_in_seconds"]

type​

  • Required: Yes
  • type: string
  • enum: ["WaitTimeFromResponse"]

wait_time_in_seconds​

The expression defining how long to wait before retrying, in seconds relative to now (convert an absolute timestamp with timestamp(...) - now_utc().timestamp()). An empty, zero, negative or non-numeric result, or an expression that cannot be evaluated on the response, defers to the next backoff strategy. Nothing bounds the wait unless max_waiting_time_in_seconds is set, so setting it is strongly recommended.

Examples:

{{ response.retry_after_seconds }}
{{ max(1, timestamp(response.error.message | regex_search('Retry after (\S+Z)')) - now_utc().timestamp()) if (response is mapping and response.get('error') is mapping and ((response.error.message or '') | string | regex_search('Retry after (\S+Z)'))) else '' }}

max_waiting_time_in_seconds​

Stop the stream instead of waiting, when the computed wait is greater than or equal to this value. Can be a hardcoded number, or a string interpolated from the connector config so that the bound can be changed without a connector release. A value of 0 means never wait. Not evaluated when a rate-limited retry can rotate to another credential with quota; any other retryable error still consults this strategy.

  • Required: No
  • Available variables: config

Examples:

3600
{{ config['max_waiting_time'] * 60 }}
  • anyOf:

    • type: number
  • anyOf:

    • type: string

$parameters​

  • Required: No
  • type: object