Restate Go SDK

June 26, 2026 Β· View on GitHub

Go Reference Go

Restate Go SDK

Restate is a system for easily building resilient applications using distributed durable async/await. This repository contains the Restate SDK for writing services in Golang.

Community

Prerequisites

  • Go: >= 1.24.0

Examples

This repo contains an example based on the Ticket Reservation Service.

You can also check a list of examples available here: https://github.com/restatedev/examples?tab=readme-ov-file#go

How to use the example

Download and run restate, as described here v1.x

restate-server

In another terminal run the example

cd restate-sdk-go/example
go run .

In a third terminal register:

restate deployments register http://localhost:9080

And do the following steps

  • Add tickets to basket
curl -v localhost:8080/UserSession/azmy/AddTicket \
    -H 'content-type: application/json' \
    -d '"ticket-1"'

# true
curl -v localhost:8080/UserSession/azmy/AddTicket \
    -H 'content-type: application/json' \
    -d '"ticket-2"'
# true

Trying adding the same tickets again should return false since they are already reserved. If you didn't check out the tickets in 15min (if you are impatient change the delay in code to make it shorter)

  • Check out
curl localhost:8080/UserSession/azmy/Checkout
# true

Ingress SDK

When you need to call restate handlers or attach to invocations from outside the restate context, use the ingress SDK.

Versions

This library follows Semantic Versioning.

Upgrading from 0.x? See the migration guide.

Compatibility with Restate Server:

Restate Serversdk-go 1.0
< 1.3❌
1.3βœ… (1)(2)
1.4βœ… (2)
1.5βœ…
1.6βœ…
1.7βœ…

(1) WithAbortTimeout, WithEnableLazyState, WithIdempotencyRetention, WithInactivityTimeout, WithIngressPrivate, WithJournalRetention and WithWorkflowRetention require Restate Server >= 1.4. Check the in-code documentation for more details.

(2) WithInvocationRetryPolicy requires Restate Server >= 1.5. Check the in-code documentation for more details.

Older 0.x SDK releases are legacy and deprecated; see the Restate 1.5 release notes for their compatibility and deprecation details.

Contributing

We’re excited if you join the Restate community and start contributing! Whether it is feature requests, bug reports, ideas & feedback or PRs, we appreciate any and all contributions. We know that your time is precious and, therefore, deeply value any effort to contribute!