https://github.com/restatedev/examples
Restate examples
https://github.com/restatedev/examples
Last synced: 6 months ago
JSON representation
Restate examples
- Host: GitHub
- URL: https://github.com/restatedev/examples
- Owner: restatedev
- License: mit
- Created: 2023-08-10T08:00:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-13T18:15:37.000Z (6 months ago)
- Last Synced: 2026-01-13T18:43:22.003Z (6 months ago)
- Language: TypeScript
- Homepage: https://restate.dev
- Size: 8.11 MB
- Stars: 139
- Watchers: 7
- Forks: 27
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-durable-executions - Restate examples
README
[](https://docs.restate.dev)
[](https://discord.gg/skW3AZ6uGd)
[](https://join.slack.com/t/restatecommunity/shared_invite/zt-2v9gl005c-WBpr167o5XJZI1l7HWKImA)
[](https://x.com/intent/follow?screen_name=restatedev)
# Restate examples
A collection of examples that illustrate how to use Restate to solve common application
challenges.
* **Basics:** Small examples highlighting the basic building blocks, like
durable execution or virtual objects.
* **Use Cases and Patterns:** Small specific use cases, like webhooks,
workflows, asynchronous task queuing.
* **Integrations:** Examples of integrating Restate with other popular tools, technologies, and libraries.
* **End-to-End Applications:** Runnable demo applications that consist
of many components, e.g., a food ordering app, or an e-commerce site.
Typically packaged as a docker compose setup.
* **Templates:** Project templates for various languages, build systems and runtimes.
Simple 'Hello World!' examples in a proper build setup that you can use if you want to start
a brand new project for a service or lambda that will be invoked through Restate.
* **Tutorials:** A step-by-step guide that builds an application and introduces
the Restate concepts on the way.
## Example catalogs
Have a look at the example catalog for your preferred SDK language:
[](typescript)
[](go)
[](python)
[](java)
[](kotlin)
[](rust)
Or have a look at the general catalog below:
#### Basics
| Example Name | Languages |
|-------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Services - Durable Execution | [
](typescript/basics/src/0_durable_execution.ts) [
](go/basics/part0/durableexecution.go) [
](python/basics/app/0_durable_execution.py) [
](java/basics/src/main/java/durable_execution/SubscriptionService.java) [
](kotlin/basics/src/main/kotlin/durable_execution/SubscriptionService.kt) [
](rust/basics/src/p0_durable_execution.rs) |
| Durable Building Blocks | [
](typescript/basics/src/1_building_blocks.ts) [
](go/basics/part1/buildingblocks.go) [
](python/basics/app/1_building_blocks.py) [
](java/basics/src/main/java/building_blocks/MyService.java) [
](kotlin/basics/src/main/kotlin/building_blocks/MyService.kt) [
](rust/basics/src/p1_building_blocks.rs) |
| Virtual Objects | [
](typescript/basics/src/2_virtual_objects.ts) [
](go/basics/part2/virtualobjects.go) [
](python/basics/app/2_virtual_objects.py) [
](java/basics/src/main/java/virtual_objects/GreeterObject.java) [
](kotlin/basics/src/main/kotlin/virtual_objects/GreeterObject.kt) [
](rust/basics/src/p2_virtual_objects.rs) |
| Workflows | [
](typescript/basics/src/3_workflows.ts) [
](go/basics/part3/workflows.go) [
](python/basics/app/3_workflows.py) [
](java/basics/src/main/java/workflows/SignupWorkflow.java) [
](kotlin/basics/src/main/kotlin/workflows/SignupWorkflow.kt) [
](rust/basics/src/p3_workflows.rs) |
#### Use Cases and Patterns
| Example Name | Languages |
|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Durable RPC, Idempotency & Concurrency | [
](typescript/patterns-use-cases/README.md#durable-rpc-idempotency--concurrency) [
](go/patterns-use-cases/README.md#durable-rpc-idempotency--concurrency) [
](python/patterns-use-cases/README.md#durable-rpc-idempotency--concurrency) [
](java/patterns-use-cases/README.md#durable-rpc-idempotency--concurrency) |
| \(Delayed\) Message Queue | [
](typescript/patterns-use-cases/README.md#delayed-message-queue) [
](go/patterns-use-cases/README.md#delayed-message-queue) [
](python/patterns-use-cases/README.md#delayed-message-queue) [
](java/patterns-use-cases/README.md#delayed-message-queue) [
](kotlin/patterns-use-cases/README.md#delayed-message-queue) |
| Webhook Callbacks | [
](typescript/patterns-use-cases/README.md#webhook-callbacks) [
](go/patterns-use-cases/README.md#webhook-callbacks) |
| Sagas | [
](typescript/patterns-use-cases/README.md#sagas) [
](go/patterns-use-cases/README.md#sagas) [
](python/patterns-use-cases/README.md#sagas) [
](java/patterns-use-cases/README.md#sagas) [
](kotlin/patterns-use-cases/README.md#sagas) |
| Cron Jobs | [
](typescript/patterns-use-cases/README.md#cron-jobs) [
](go/patterns-use-cases/README.md#cron-jobs) [
](java/patterns-use-cases/README.md#cron-jobs) |
| Database Interaction Patterns | [
](typescript/patterns-use-cases/README.md#database-interaction-patterns) |
| Convert Sync Tasks to Async | [
](typescript/patterns-use-cases/README.md#convert-sync-tasks-to-async) [
](go/patterns-use-cases/README.md#convert-sync-tasks-to-async) [
](python/patterns-use-cases/README.md#convert-sync-tasks-to-async) [
](java/patterns-use-cases/README.md#convert-sync-tasks-to-async) |
| Batching | [
](typescript/patterns-use-cases/README.md#batching) [
](java/patterns-use-cases/README.md#batching) |
| Payments Signals \(Advanced\) | [
](typescript/patterns-use-cases/README.md#payment-signals) [
](python/patterns-use-cases/README.md#payment-signals) [
](java/patterns-use-cases/README.md#payment-signals) |
| Stateful Actors and State Machines | [
](typescript/patterns-use-cases/README.md#stateful-actors-and-state-machines) [
](go/patterns-use-cases/README.md#stateful-actors-and-state-machines) [
](python/patterns-use-cases/README.md#stateful-actors-and-state-machines) [
](java/patterns-use-cases/README.md#stateful-actors-and-state-machines) |
| Payment State Machines \(Advanced\) | [
](typescript/patterns-use-cases/README.md#payment-state-machines) [
](python/patterns-use-cases/README.md#payment-state-machines) [
](java/patterns-use-cases/README.md#payment-state-machines) |
| Scheduling Tasks | [
](typescript/patterns-use-cases/README.md#scheduling-tasks) [
](go/patterns-use-cases/README.md#scheduling-tasks) [
](python/patterns-use-cases/README.md#scheduling-tasks) [
](java/patterns-use-cases/README.md#scheduling-tasks) [
](kotlin/patterns-use-cases/README.md#scheduling-tasks) | |
| Concurrent async tasks | [
](java/patterns-use-cases/README.md#sagas) |
| Parallelizing Work | [
](typescript/patterns-use-cases/README.md#parallelizing-work) [
](go/patterns-use-cases/README.md#parallelizing-work) [
](python/patterns-use-cases/README.md#parallelizing-work) [
](java/patterns-use-cases/README.md#parallelizing-work) [
](kotlin/patterns-use-cases/README.md#parallelizing-work) |
| Transactional Event Processing | [
](typescript/patterns-use-cases/README.md#transactional-event-processing) [
](go/patterns-use-cases/README.md#transactional-event-processing) [
](python/patterns-use-cases/README.md#transactional-event-processing) [
](java/patterns-use-cases/README.md#transactional-event-processing) [
](kotlin/patterns-use-cases/README.md#transactional-event-processing) |
| Event Enrichment / Joins | [
](typescript/patterns-use-cases/README.md#event-enrichment--joins) [
](go/patterns-use-cases/README.md#event-enrichment--joins) [
](python/patterns-use-cases/README.md#event-enrichment--joins) [
](java/patterns-use-cases/README.md#event-enrichment--joins) [
](kotlin/patterns-use-cases/README.md#event-enrichment--joins) |
| Durable Promises as a Service | [
](typescript/patterns-use-cases/README.md#durable-promises-as-a-service) |
| Priority Queue | [
](typescript/patterns-use-cases/README.md#priority-queue) |
| Rate Limiting | [
](typescript/patterns-use-cases/README.md#rate-limiting) [
](go/patterns-use-cases/README.md#rate-limiting) |
| AI: agents, LLM calls, MCP, A2A,... | [AI examples repo](https://github.com/restatedev/ai-examples) |
#### Integrations
| Example Name | Languages |
|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| AWS Lambda + CDK | [
](typescript/integrations/deployment-lambda-cdk) [
](go/integrations/go-lambda-cdk) [
](java/integrations/java-gradle-lambda-cdk) [
](kotlin/integrations/kotlin-gradle-lambda-cdk) |
| XState | [
](typescript/integrations/xstate) |
| Knative | [
](go/integrations/knative-go) |
#### End-to-End Applications
| Example Name | Languages |
|-----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Food Ordering App | [
](typescript/end-to-end-applications/food-ordering) [
](python/end-to-end-applications/food-ordering) [
](java/end-to-end-applications/food-ordering) [
](kotlin/end-to-end-applications/food-ordering) |
| Image Workflow Parser & Executor | [
](typescript/end-to-end-applications/ai-image-workflows) [
](java/end-to-end-applications/workflow-interpreter) |
| LLM-powered Chat Bot / Task Agent | [
](typescript/end-to-end-applications/chat-bot) [
](python/end-to-end-applications/chat-bot) |
| Subway Fare Calculator | [
](java/end-to-end-applications/subway-fare-calculator) |
| RAG Ingestion | [
](python/end-to-end-applications/rag-ingestion) |
| Kotlin Todo App | [
](kotlin/end-to-end-applications/kmp-android-todo-app) |
| AI: agentic workflows, MCP, A2A,... | [AI examples repo](https://github.com/restatedev/ai-examples) |
#### Templates
[
](typescript/templates)
[
](go/templates)
[
](python/templates)
[
](java/templates)
[
](kotlin/templates)
[
](rust/templates)
[AI templates](https://github.com/restatedev/ai-examples)
#### Tutorials
| Tutorial Name | Languages |
|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Tour of Workflows | [
](typescript/tutorials/tour-of-workflows-typescript) [
](go/tutorials/tour-of-workflows-go) [
](python/tutorials/tour-of-workflows-python) [
](java/tutorials/tour-of-workflows-java) |
| Tour of Orchestration | [
](typescript/tutorials/tour-of-orchestration-typescript) [
](go/tutorials/tour-of-orchestration-go) [
](python/tutorials/tour-of-orchestration-python) [
](java/tutorials/tour-of-orchestration-java) |
| Tour of Agents | [AI examples repo](https://github.com/restatedev/ai-examples) |
## Joining the community
If you want to join the Restate community in order to stay up to date, then please join our [Discord](https://discord.gg/skW3AZ6uGd) or [Slack](https://join.slack.com/t/restatecommunity/shared_invite/zt-2v9gl005c-WBpr167o5XJZI1l7HWKImA).
This 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 explain
how to get them running. Here are the general steps:
### (1) Starting the Restate Server
To run an example locally, you need a running Restate Server instance.
Some examples can be run with Docker Compose. Those already bring their own Restate server instance.
To install the Restate Server and CLI, have a look at the [installation instructions in the documentation](https://docs.restate.dev/develop/local_dev#running-restate-server--cli-locally).
### (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:
* Via the [CLI](https://docs.restate.dev/develop/local_dev): `restate deployments register localhost:9080`
* Via `curl localhost:9070/deployments -H 'content-type: application/json' -d '{"uri": "http://localhost:9080"}'`
**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:
* Make sure it has a README
* Add it to the following catalogs: the one in this readme, the language-specific catalog, and the patterns-use-cases catalog if it is a pattern.
* Check it's listed in run tests/update examples scripts in [`.tools`](./.tools)
* Optionally, add it to the [zips script](./.tools/prepare_release_zip.sh) and [`release.yaml`](./.github/workflows/release.yml)
**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`:
```shell
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](https://github.com/restatedev/examples/releases) on GitHub, which you need to approve to finalize it.
Please update the version tag referenced on the [Tour of Restate](https://github.com/restatedev/documentation) documentation page.