Skip to content

restatedev/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation Discord Slack Twitter

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 Image Image Image Image Image Image
Durable Building Blocks Image Image Image Image Image Image
Virtual Objects Image Image Image Image Image Image
Workflows Image Image Image Image Image Image

Use Cases and Patterns

Example Name Languages
Durable RPC, Idempotency & Concurrency Image Image Image Image
(Delayed) Message Queue Image Image Image Image Image
Webhook Callbacks Image Image
Sagas Image Image Image Image Image
Cron Jobs Image Image Image
Database Interaction Patterns Image
Convert Sync Tasks to Async Image Image Image Image
Batching Image Image
Payments Signals (Advanced) Image Image Image
Stateful Actors and State Machines Image Image Image Image
Payment State Machines (Advanced) Image Image Image
Scheduling Tasks Image Image Image Image Image
Concurrent async tasks Image
Parallelizing Work Image Image Image Image Image
Transactional Event Processing Image Image Image Image Image
Event Enrichment / Joins Image Image Image Image Image
Durable Promises as a Service Image
Priority Queue Image
Rate Limiting Image Image
AI: agents, LLM calls, MCP, A2A,... AI examples repo

Integrations

Example Name Languages
AWS Lambda + CDK Image Image Image Image
XState Image
Knative Image

End-to-End Applications

Example Name Languages
Food Ordering App Image Image Image Image
Image Workflow Parser & Executor Image Image
LLM-powered Chat Bot / Task Agent Image Image
Subway Fare Calculator Image
RAG Ingestion Image
Kotlin Todo App Image
AI: agentic workflows, MCP, A2A,... AI examples repo

Templates

Image Image Image Image Image Image

AI templates

Tutorials

Tutorial Name Languages
Tour of Workflows Image Image Image Image
Tour of Orchestration Image Image Image Image
Tour of Agents AI examples repo

Joining the community

If you want to join the Restate community in order to stay up to date, then please join our Discord or Slack. 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.

(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: 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
  • Optionally, add it to the zips script and release.yaml

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.

About

Restate examples

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 15