Request Processing Lifecycle
When Restate receives a request to invoke a handler, it follows this detailed process:1. Persist Request
Restate persists the request and creates a new execution journal for this invocation. From this point, Restate guarantees that it will process the request to completion, even in the face of failures.2. Forward to Service
Restate opens a bidirectional streaming connection (HTTP/2) to the service for which the request is meant. This connection will be used to stream messages back and forth between the Server and the SDK. It then forwards the request to the service.3. Invoke Handler
The Restate SDK, embedded in the service, calls the handler with the request data and a context object that provides access to Restate features like state management, service calls, and timers.4. Track Execution
As the handler runs, it uses the Restate Context to call other services, update state, or perform side effects. The Restate SDK under-the-hood sends a message to the Restate server for each Context operation. The Restate Server then records it in the execution journal.5. Handle Failures
If the handler crashes or fails, Restate either loses the connection or receives an error message. In this case, the Restate Server will send a retry request to the service, including the latest journal. Failure detection mechanisms:- Connection between Server and service dropped
- Explicit error messages (not terminal errors)
- Inactivity timeouts reached