Skip to main content
When your code fails, Restate automatically retries the invocation. Understanding when to stop retrying is critical to building reliable applications.
Check out the Error Handling guide to learn more about how Restate handles transient errors, terminal errors, retries, and timeouts.

Understanding Retryable vs Terminal Errors

Retryable errors are temporary problems that might succeed if retried:
  • Database connection timeout
  • Network issues
  • Temporary service unavailability
Terminal errors are permanent failures that won’t be fixed by retrying:
  • Invalid user input (wrong format, missing required fields)
  • Authorization failures (user doesn’t have permission)
  • Business logic violations (insufficient balance, duplicate order)
By default, Restate retries ALL errors, except TerminalErrors.

Raising TerminalError

Use TerminalError to signal permanent failures. When you raise TerminalError in your handler code, it stops the invocation and marks it as permanently failed. You can attach a status code and structured metadata to give callers machine-readable failure details:
The message, status code, and metadata are recorded with the failure and propagated to callers. Catch