Skip to content

Add scoped_client, add lookup_workflow and handle on the workflow generated client - #129

Merged
slinkydeveloper merged 4 commits into
mainfrom
workflow-handle
Sep 22, 2026
Merged

slinkydeveloper merged 4 commits into
mainfrom
workflow-handle

Conversation

@slinkydeveloper

@slinkydeveloper slinkydeveloper commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds two additive capabilities to the generated ingress clients, plus the underlying transport support:

  • scoped_client(...) — an alternative constructor (alongside from_client) that binds a generated ingress client to a Restate Cloud scope. Every request the client issues (and its workflow handle() lookup) is routed through the /restate/scope/{scope}/... prefix.
  • Workflow handle() — generated workflow ingress clients expose an async handle() that resolves the InvocationHandle for 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's run handler output.
  • Client::lookup_workflow(name, key, scope) — public transport method that resolves a workflow invocation to a typed InvocationHandle through the /restate/lookup route (backed by a new post_json helper and LookupRequest/LookupResponse wire types).

A workflow that declares a handler literally named handle has its generated method renamed to _handle so the injected lookup keeps the plain handle name; the on-the-wire handler name is unchanged.

Testing

  • New unit tests in tests/ingress_client.rs covering lookup_workflow (scoped and unscoped bodies, error paths), the generated workflow handle() (including scoped clients and the handle name collision), and scoped request routing for services/objects/workflows.
  • End-to-end coverage in testcontainers/tests/test_container.rs for service, virtual object (exclusive + shared), and workflow submit-then-handle().attach().
  • README ingress section and a release-notes/unreleased/ entry document the new APIs.

Requires Restate >= 1.7 for the /restate/lookup and scopes

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Test Results

  8 files  ±0    8 suites  ±0   3m 36s ⏱️ +36s
 51 tests ±0   51 ✅ ±0  0 💤 ±0  0 ❌ ±0 
222 runs  ±0  222 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit b27b5ee. ± Comparison against base commit 33c57d2.

♻️ This comment has been updated with latest results.

Add lookup_workflow and handle on the workflow generated client
slinkydeveloper and others added 2 commits September 4, 2026 13:54
- 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>
@slinkydeveloper
slinkydeveloper merged commit dcade6f into main Sep 22, 2026
4 checks passed
@slinkydeveloper
slinkydeveloper deleted the workflow-handle branch September 22, 2026 10:01
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant