diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index a66e4d6a..5943d487 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -92,6 +92,24 @@ message ActivityType { string name = 1; } +// Backoff setting for a specific error. This message is designed to be used as a value +// of error backoff overrides in the RetryPolicy message. +message BackoffSettings { + // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. + google.protobuf.Duration initial_interval = 1 [(gogoproto.stdduration) = true]; + // Coefficient used to calculate the next retry interval. + // The next retry interval is previous interval multiplied by the coefficient. + // Must be 1 or larger. + double backoff_coefficient = 2; + // Maximum interval between retries. Exponential backoff leads to interval increase. + // This value is the cap of the increase. Default is 100x of the initial interval. + google.protobuf.Duration maximum_interval = 3 [(gogoproto.stdduration) = true]; + // Maximum number of attempts. When exceeded the retries stop even if not expired yet. + // 1 disables retries. 0 means unlimited (up to the timeouts) + int32 maximum_attempts = 4; +} + + // How retries ought to be handled, usable by both workflows and activities message RetryPolicy { // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. @@ -109,6 +127,9 @@ message RetryPolicy { // Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that // this is not a substring match, the error *type* (not message) must match exactly. repeated string non_retryable_error_types = 5; + // Customize backoff settings for specific errors. + // Similar to 'Non-Retryable', the key should precisely match the error *type*. + map error_backoff_overrides = 6; } // Metadata relevant for metering purposes