Restate services can run in two ways: as an HTTP endpoint or as AWS Lambda functions.

Creating an HTTP endpoint

  1. Use either or as SDK dependency.
  2. Create an endpoint
  3. Bind one or multiple services to it
  4. Listen on the specified port (default 9080) for connections and requests.
On JDK 23+, the SDK uses a native library and prints a native-access warning at startup. To silence it, enable native access by passing --enable-native-access=ALL-UNNAMED as a JVM argument, or by setting Enable-Native-Access: ALL-UNNAMED in your JAR manifest.

Creating a Lambda handler

  1. Use either or as SDK dependency.
  2. Extend the class BaseRestateLambdaHandler
  3. Override the register method
  4. Bind one or multiple services to the builder
The implementation of your services and handlers remains the same for both deployment options. Have a look at the deployment section for guidance on how to deploy your services on AWS Lambda.

Handler execution

For Java services, the SDK uses virtual threads by default on JDK 21 and newer. On older JDK versions, it falls back to Executors.newCachedThreadPool(). Kotlin services use Dispatchers.Default by default.
Override the Java executor or Kotlin coroutine context when your service needs a different execution model:

Validating request identity

SDKs can validate that incoming requests come from a particular Restate instance. You can find out more about request identity in the Security docs. You will need to use the request identity dependency .