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
- Invalid user input (wrong format, missing required fields)
- Authorization failures (user doesn’t have permission)
- Business logic violations (insufficient balance, duplicate order)
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: