Home

Awesome

Documentation Discord Twitter

Restate examples

A collection of examples that illustrate how to use Restate to solve common application challenges.

Examples by Language

TypeScript

TypeName / Link
BasicsWorkflows, Durable Execution, Event-processing, Virtual Objects
Use CasesSagas
Use CasesDurable Promises
Use CasesState Machines
Use CasesPayment Service
Use CasesAsync Tasks - Payments
End-to-EndFood Ordering App
End-to-EndAI Image Processing Workflow
End-to-EndLLM-powered Chat Bot / Task Agent
TutorialTour of Restate
TemplatesRestate Node/TS Template
TemplatesRestate Bun/TS Template
TemplatesRestate CloudFlare Workers/TS Template
TemplatesRestate Deno/TS Template
TemplatesTesting Restate app with Test Containers

Java

TypeName / Link
TemplatesMaven Template
TemplatesMaven - Spring Boot Template
TemplatesMaven - Quarkus Template
TemplatesGradle Template
BasicsDurable Execution, Event-processing, Virtual Objects
Use CasesSagas
Use CasesPayment Service
Use CasesAsync Tasks - Payments
PatternsSpring & Spring JPA
End-to-EndFood Ordering App
TutorialTour of Restate

Kotlin

TypeName / Link
TemplatesTemplate using Gradle
BasicsDurable Execution, Event-processing, Virtual Objects
Use CasesSagas
End-to-EndFood Ordering App
End-to-EndTodos Kotlin Multiplatform + Android app

Python

TypeName / Link
TemplatesPython Template
BasicsDurable Execution, Event-processing, Virtual Objects
End-to-EndFood Ordering App
TutorialTour of Restate

Go

TypeName / Link
TemplatesGo Template
TutorialTour of Restate
TutorialRestate + Knative

Rust

TypeName / Link
TemplatesRust Template
TemplatesRust - Shuttle.rs Template

Joining the community

If you want to join the Restate community in order to stay up to date, then please join our Discord. The Discord server is also the perfect place for sharing your feedback with us, learning more about Restate and connect with others!

Running the examples

Some examples are just illustrations of code, but many are runnable. Their READMEs generally explain how to get them running. Here are the general steps:

(1) Starting the Restate Server

Examples that run individually typically need a running Restate Server instance. Some examples can be run with Docker Compose. Those already bring their own Restate server instance.

You can launch Restate in a number of ways, including using the Restate Cloud service. See Get Restate for all options to run Restate. Here is a short-list of options to run Restate Server locally.

Install and run the restate-server binary:

(2) Register the examples at Restate Server

The service endpoints need to be registered in Restate, so that Restate will proxy their function calls and do its magic. Once both server and example are running, register the example:

Important When running Restate with Docker, use host.docker.internal instead of localhost in the URIs above.



Adding Examples and Releasing (for Restate developers/contributors)

When adding a new example:

Creating a Release

Before releasing, trigger the "pre-release" workflow to update sdk versions. This automatically creates a pull request, which must be manually merged.

Once the repo is ready for the release, push a tag of the form vX.Y.Z:

git checkout main
git tag -m "Examples v0.9.1" v0.9.1
git push origin v0.9.1

This triggers a workflow that creates a draft release on GitHub, which you need to approve to finalize it.

Please update the version tag referenced on the Tour of Restate documentation page.