Constructor
Parameters
string
required
The error message describing what went wrong.
RetryableErrorOptions
Configuration options for the retry behavior.
Properties
string
Always set to
"RetryableError".string
The error message provided to the constructor.
Date
The Date when the step should be retried.
string
The stack trace where the error was thrown.
Static Methods
(value: unknown) => boolean
Type guard to check if a value is a RetryableError.
Usage
Basic Retry
Retry with default 1 second delay:Custom Retry Delay (Duration String)
Specify retry delay as a duration string:Custom Retry Delay (Milliseconds)
Specify retry delay in milliseconds:Retry at Specific Time
Schedule retry for a specific date/time:Exponential Backoff
Implement exponential backoff using step metadata:Rate Limit Handling
Handle API rate limits:Conditional Retry Logic
Decide retry strategy based on error type:Max Attempts with Retry
Limit retry attempts:Type Guard Usage
Check if an error is retryable:Long Delays
Retry after extended periods:Duration Format
TheretryAfter option accepts duration strings in the following formats:
"1000ms"- Milliseconds"1s"- Seconds"1m"- Minutes"1h"- Hours"1d"- Days
Default Behavior
IfretryAfter is not specified, the step will be retried after 1 second (1000 milliseconds).
Notes
- Retryable errors cause the step to be retried after the specified delay
- The step will be re-executed from the beginning on each retry
- Use
getStepMetadata().attemptto track the current attempt number - Combine with
FatalErrorto handle different error scenarios - The
retryAfterdate is calculated at the time the error is thrown - Very long retry delays (hours/days) are supported
Related
- FatalError - Throw a non-retryable error
- getStepMetadata - Get current step attempt number
- sleep - Pause workflow execution