# restate

> restate, a magmalake tin: Durable execution in Mojo, via Restate.

[magmalake](https://magmalake.dev/) [restate](https://magmalake.dev/s/restate)

Durable execution in Mojo, via Restate. A Rust shim embeds the official Restate SDK — Rust owns the HTTP/2 endpoint, the event loop and the journal — while your handlers are Mojo, driven by a synchronous loop where every durable operation crosses one C-ABI call.

Install

mojoshelf:

```
pixi shelf add restate-mojo
```

`pixi shelf` comes with mojoshelf: [install it first](https://mojoshelf.org/getting-started).

plain pixi:

```
pixi init app -c https://conda.modular.com/max -c conda-forge && cd app
sed -i.bak 's/^\[workspace\]/[workspace]\npreview = ["pixi-build"]/' pixi.toml
pixi add "mojo-compiler==1.2.0"
# Without mojoshelf: the tin as a git dependency at its published commit.
# Transitive dependencies may be wrong: pixi takes the tin's own git deps as
# pinned in its pixi.toml, which may not match what other tins pin, and then
# fails with "duplicate records". mojoshelf picks revisions that agree.
pixi add restate-mojo --git https://github.com/magmalake/restate.mojo --rev e391b04b0de1f0c1f5f1b5ab736d43d171e4d1f8
```

No mojoshelf needed. If pixi reports duplicate records, the mojoshelf tab picks revisions that agree.

Version

`0.4.1` on mojoshelf

Source

[GitHub](https://github.com/magmalake/restate.mojo) [README](https://github.com/magmalake/restate.mojo#readme)

## Works today

- State, sleep, run and awakeables from handle\_\* functions App.run finds by name
- app.serve(num\_workers) runs that loop on N threads via threads-mojo's WorkerPool
- Self-calls need two or more workers: one worker has no second thread to run the callee
- Payloads are raw bytes — parse and serialize in your handler

Checked against Two end-to-end suites against a real restate-server booted per run, on macOS and Linux

- [Orca](https://magmalake.dev/s/orca) pipelines as DAGs · cron schedules · backfills
- [Dista](https://magmalake.dev/s/dista) distributed tasks · actors · results that stay on workers
- [Every tin](https://magmalake.dev/tins)

[A magmalake project](https://magmalake.dev/)

Apache 2.0 · © 2026 Marius Seritan
