Repository navigation
Add scoped_client, add lookup_workflow and handle on the workflow generated client - #129
Merged
Merged
Conversation
Add lookup_workflow and handle on the workflow generated client
slinkydeveloper
force-pushed
the
workflow-handle
branch
from
September 4, 2026 11:51
55f4b11 to
2b81f2f
Compare
- Add release note for scoped_client + workflow handle() lookup - Document scoped_client and workflow handle() in the README ingress section - Fix stale comment: the handle-name collision renames to `_handle`, not `handle_handle` Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two additive capabilities to the generated ingress clients, plus the underlying transport support:
scoped_client(...)— an alternative constructor (alongsidefrom_client) that binds a generated ingress client to a Restate Cloud scope. Every request the client issues (and its workflowhandle()lookup) is routed through the/restate/scope/{scope}/...prefix.handle()— generated workflow ingress clients expose an asynchandle()that resolves theInvocationHandlefor the workflow invocation keyed by the client's key, so a workflow can be re-attached by key alone without persisting the submission-time invocation ID. The handle is typed to the workflow'srunhandler output.Client::lookup_workflow(name, key, scope)— public transport method that resolves a workflow invocation to a typedInvocationHandlethrough the/restate/lookuproute (backed by a newpost_jsonhelper andLookupRequest/LookupResponsewire types).A workflow that declares a handler literally named
handlehas its generated method renamed to_handleso the injected lookup keeps the plainhandlename; the on-the-wire handler name is unchanged.Testing
tests/ingress_client.rscoveringlookup_workflow(scoped and unscoped bodies, error paths), the generated workflowhandle()(including scoped clients and thehandlename collision), and scoped request routing for services/objects/workflows.testcontainers/tests/test_container.rsfor service, virtual object (exclusive + shared), and workflow submit-then-handle().attach().release-notes/unreleased/entry document the new APIs.Requires Restate >= 1.7 for the
/restate/lookupand scopes🤖 Generated with Claude Code