Skip to main content
2026-04-02
Go SDK v0.24.0

What’s Changed

New Contributors

View on GitHub
2026-01-05
Go SDK v0.23.0

What’s Changed

Better integration with go’s Context

We have improved the interoperability with go’s Context, you can now wrap any context inside restate.Context using restate.WrapContext:
func TracingExample(ctx restate.Context) error {
	// Create a span
	traceCtx, exampleSpan := otelTracer.Start(ctx, "Example")
	// Wrap the traceCtx created by otel in the restate context.
	ctx = restate.WrapContext(ctx, traceCtx)
	defer exampleSpan.End()

	return restate.RunVoid(ctx, func(ctx restate.RunContext) error {
		// RunContext will propagate correctly the wrapped otel context too. 
		_, innerExampleSpan := otelTracer.Start(ctx, "InnerExample")
		defer innerExampleSpan.End()

		// Do something
		return nil
	})
}
You can also propagate values manually in the usual way using restate.WithValue:
// Wrap using restate.WithValue
ctx = restate.WithValue(ctx, "tenant", tenant)

restate.Run(ctx, func(ctx restate.RunContext) (string, error) {
  // Extract using context APIs
  tenant := ctx.Value("tenant").(string)
})

Other changes

View on GitHub
2025-12-16
Go SDK v0.22.1

What’s Changed

View on GitHub
2025-11-20
Go SDK v0.22.0

New features:

  • Added restate.RunVoid as shortcut method to execute runs that return no value:
err = restate.RunVoid(ctx, func(stepCtx restate.RunContext) error {
  return DoStuff()  
})
Thanks @chronark for the contribution!
  • Added test environment using testcontainers:
import (
	"testing"

	restatetest "github.com/restatedev/sdk-go/testing"
	"github.com/restatedev/sdk-go/ingress"
)

func TestWithTestcontainers(t *testing.T) {
	// Setup test environment
	tEnv := restatetest.Start(t, restate.Reflect(Greeter{}))
	// Client to do requests
	client := tEnv.Ingress()

	// Do request to greeter, and assert response
	out, err := ingress.Service[string, string](client, "Greeter", "Greet").Request(t.Context(), "Francesco")
	require.NoError(t, err)
	require.Equal(t, "You said hi to Francesco!", out)
}

New Contributors

View on GitHub
2025-10-29
Go SDK v0.21.1

What’s Changed

View on GitHub
2025-10-20
Go SDK v0.21.0

New features

  • protoc-restate-go now generates ingress clients
counterClient := helloworld.NewCounterIngressClient(client, "my-counter-key")

addRes, err := counterClient.Add().Request(ctx, &helloworld.AddRequest{Delta: 1}, restate.WithDelay(10*time.Second))
  • New API to concurrently wait Restate Futures:
    • WaitFirst to wait the first of the given futures to complete
fut1 := restate.Service[string](ctx, "service1", "method1").RequestFuture(input)
fut2 := restate.After(ctx, 5 * time.Second)

firstCompleted, err := restate.WaitFirst(ctx, fut1, fut2, fut3)
if err != nil {
	return "", err
}
// Handle the first completed future
switch firstCompleted {
case fut1:
	return fut1.Response()
case fut2:
	return "", fmt.Errorf("timeout")
}
  • Wait to create an iterator (usable in for range) to await futures as soon as they’re completed
fut1 := restate.Service[string](ctx, "service1", "method1").RequestFuture(input)
fut2 := restate.Service[string](ctx, "service2", "method2").RequestFuture(input)
fut3 := restate.Service[string](ctx, "service3", "method3").RequestFuture(input)

results := []string{}
for fut, err := range restate.Wait(ctx, fut1, fut2, fut3) {
	if err != nil {
		return nil, err
	}
	result, err := fut.(restate.ResponseFuture[string]).Response()
	if err != nil {
		return nil, err
	}
	results = append(results, result)
}
  • WaitIter, like Wait, but with a “traditional iterator” API
  • All the new selector API now correctly support Restate cancellation feature.

Deprecations

  • restate.Rand(ctx).UUID() -> restate.UUID(ctx)
  • restate.Rand(ctx).Source() -> restate.RandSource(ctx)
  • In subsequent releases, restate.Rand(ctx) will return math/rand/v2 Rand object instead of the internal interface.
  • Few changes to the Ingress API, including renaming the Attach* API:
    • AttachInvocation -> InvocationById
    • AttachService -> ServiceInvocationByIdempotencyKey
    • AttachObject -> ObjectInvocationByIdempotencyKey
    • AttachWorkflow -> WorkflowHandle
  • Select API is deprecated, replace it with WaitFirst, Wait or WaitIter

Breaking changes

  • Ingress API
    • Send return type changed, now it returns SendResponse/SimpleSendResponse and splits result type to error type.
    • Return type of Service/Object/Workflow now doesn’t implement anymore SendRequester, but was replaced with an ad-hoc interface to carry on the generic information

Fixes

  • Ingress API deserialized incorrectly send and attach responses, when used in combination with a Codec different from the default one.

Full changelog

View on GitHub
2025-10-07
Go SDK v0.20.2

What’s Changed

View on GitHub
2025-10-07
Go SDK v0.20.1

What’s Changed

View on GitHub
2025-09-17
Go SDK v0.20.0

Invocation retry policy

When used with Restate 1.5, you can now configure the invocation retry policy from the SDK directly. See https://github.com/restatedev/restate/releases/tag/v1.5.0 for more details on the new invocation retry policy configuration.

More configuration

Allow to configure per-handler options in the reflection API through ConfigureHandler.

What’s Changed

View on GitHub
2025-08-18
Go SDK v0.19.0

What’s Changed

New Contributors

View on GitHub
2025-07-21
Go SDK v0.18.1
Fix goroutine leak in read path, see https://github.com/restatedev/sdk-go/pull/86 for more details.View on GitHub
2025-07-02
Go SDK v0.18.0
  • Added new options for services and handlers WithAbortTimeout, WithEnableLazyState, WithIdempotencyRetention, WithInactivityTimeout, WithIngressPrivate, WithJournalRetention and WithWorkflowRetention. Please note, these will work only from Restate 1.4 onward. Check the in-code documentation for more details.
  • Introduce new ingress client, thanks @strobus for the contribution!
  • Several improvements to error messages
  • Fix bug with protojson and schema generation

Changelog

View on GitHub
2025-06-17
Go SDK v0.17.1

What’s changed

https://github.com/restatedev/sdk-go/pull/73 - fix a bug related to HTTP1.1 serversView on GitHub
2025-04-29
Go SDK v0.17.0

What’s Changed

View on GitHub
2025-04-09
Go SDK v0.16.0
We’re pleased to announce the release of Golang SDK 0.16, in combination with Restate 1.3. Check out the announcement blog post for more details about Restate 1.3 and the new SDK features: https://restate.dev/blog/announcing-restate-1.3/This SDK introduces the following new APIs:Golang SDK 0.16 can be used in combination with Restate 1.3 onward.

Full changelog

New Contributors

View on GitHub
2025-02-12
Go SDK v0.15.0

What’s Changed

View on GitHub
2025-01-20
Go SDK v0.14.0

What’s Changed

View on GitHub
2024-12-11
Go SDK v0.13.2
Fix go.mod to allow go install to workView on GitHub
2024-11-26
Go SDK v0.13.1

What’s Changed

New Contributors

View on GitHub
2024-11-08
Go SDK v0.12.0

What’s Changed

View on GitHub
2024-08-23
Go SDK v0.11.0
This PR breaks essentially the entire API, as methods have been moved from Context.Run et all to restate.Run(ctx) et all, which is much more pleasant.Serialisation issues will now always panic - this allows us to take error return values out of various api calls that don’t need them.The semantics of .Get() have changed - the zero value is now always returned if the key isn’t found. You can check explicitly for this case by providing a pointer type eg *string. Get will now only return errors in the case of cancellation, which will also only happen if eager state is disabled, which is not the default. As such, errors from gets are now very unlikely and you can just return them without another thought.It is also notable that you can now provide many more method signatures to .Reflect().

What’s Changed

View on GitHub
2024-08-16
Go SDK v0.10.0
There are several breaking changes in this release:
  1. NewServiceRouter et al -> NewService
  2. restate.Service and restate.Object -> restate.Reflect
  3. Sleep now returns an error, which is returned in the case of invocation cancellation
There is also a significant new feature; code generation. For other changes, see below

What’s Changed

New Contributors

View on GitHub
2024-07-19
Go SDK v0.9.1

What’s Changed

View on GitHub
2024-07-17
Go SDK v0.9.0
With v0.9.0, this repository is compatible with Restate v1, and is much closer to feature complete with other repos. Correctness has been validated using the Restate verification tests in restatedev/e2e. A 1.0 release will come when we have API stability, which will not come until we have some feedback from users.

What’s Changed

New Contributors

View on GitHub