Repository navigation
Restate Rust SDK v0.12.1 Release Notes
Highlights
- Scoped ingress clients — bind a generated ingress client to a Restate Cloud scope once, instead of threading a
.scope(...)call through every request - Workflow handle lookup — re-attach to a running workflow by key alone with the new
handle()method on generated workflow ingress clients, no need to persist the invocation ID
Table of Contents
New Features
Scoped ingress clients and workflow handle lookup
Generated ingress clients gain two additions:
scoped_client(...)— an alternative constructor (alongsidefrom_client) that binds the
client to a Restate Cloud scope. Every request issued by a scoped client (and its workflow
handle()lookup) is routed through the/restate/scope/{scope}/...prefix.- Workflow
handle()— generated workflow ingress clients expose an asynchandle()method
that resolves theInvocationHandlefor the workflow invocation keyed by the client's key. The
handle is typed to the workflow'srunhandler output, soattach()/output()decode that
result. If a workflow declares a handler literally namedhandle, its generated method is renamed
to_handleso the injected lookup keeps the plainhandlename (the on-the-wire handler name is
unchanged).
At the transport level, Client::lookup_workflow(workflow_name, workflow_key, scope) is now public.
It resolves a workflow invocation to a typed InvocationHandle through the /restate/lookup route.
Why this matters:
- Restate Cloud users can target a specific scope from a single
Clientwithout threading a
.scope(...)call through every request. - Workflows can be re-attached from outside a Restate service by key alone, without having to
persist the invocation ID returned at submission time.
Impact on users:
- No breaking changes; these are purely additive APIs.
handle()andlookup_workflowrequire Restate >= 1.7 (the/restate/lookuproute).- Scoped routing requires Restate Cloud.
Example:
use restate_sdk::ingress::ReqwestClient;
let client = ReqwestClient::connect("http://localhost:8080".parse()?)?;
// Submit a workflow, then re-attach to it later by key.
let workflow = MyWorkflowIngressClient::from_client(client.clone(), "order-42");
workflow.run("input".to_owned()).send().await?;
let handle = workflow.handle().await?;
let result = handle.attach().await?.into_body();
// Scoped client: every request runs in the given Restate Cloud scope.
let scoped = MyWorkflowIngressClient::scoped_client(client, "order-42", "prod");Related Issues:
- PR #129