Skip to main content
Restate handles retries for failed invocations.
Check out the Error Handling guide to learn more about how Restate handles transient errors, terminal errors, retries, and timeouts.

Retry strategies

By default, Restate does infinite retries with an exponential backoff strategy. Check out the error handling guide to learn how to customize this.

Terminal Errors

For failures for which you do not want retries, but instead want the invocation to end and the error message to be propagated back to the caller, you can throw a terminal error. You can throw a TerminalException with an optional HTTP status code and a message anywhere in your handler, as follows:
throw new TerminalException(500, "Something went wrong");
You can catch terminal errors, and build your control flow around it.
When throwing a terminal error, undo earlier handler actions to keep the system consistent. See our sagas guide for details.
I