Generic request-response call. Routes directly by service name without a typed definition.
Optionalkey?: stringOptionalopts?: Opts<I, O>Optional Experimentalscope?: stringRoute this call within the given scope. See Ingress.scope.
NOTE: This API is experimental. To use it you need a restate-server >= 1.7,
configured to enable
service protocol v7
and flow control.
For example, start the restate-server with the environment variables
RESTATE_EXPERIMENTAL_ENABLE_PROTOCOL_V7=true and RESTATE_EXPERIMENTAL_ENABLE_VQUEUES=true.
Create a client from a VirtualObjectDefinition.
the key of the virtual object.
Create a client from a VirtualObjectDefinition.
Reject an awakeable from the ingress client.
ExperimentalReturns a ScopedIngress that routes all calls within the given scope.
NOTE: This API is in preview and is not enabled by default.
To use it in restate-server 1.7, enable the flow control and protocol v7 experimental features,
via RESTATE_EXPERIMENTAL_ENABLE_PROTOCOL_V7=true and RESTATE_EXPERIMENTAL_ENABLE_VQUEUES=true.
These can be enabled only on new clusters, for more info check out https://docs.restate.dev/services/flow-control#enabling-flow-control.
If these experimental features aren't enabled, the invocation won't be ingested and the client request fails.
A scope is a sub-grouping of resources (invocations, virtual object instances, workflow instances, concurrency limits) within the Restate cluster. It becomes part of the target identity tuple:
scope, service, handler, idempotencyKey?scope, virtualObject, objectKey, handler, idempotencyKey?scope, workflow, workflowKey, handlerUnder the hood, the scope contributes to the partition key, so all resources in a scope get co-located by the restate-server.
Omitting the scope (i.e. using the regular serviceClient / workflowClient methods)
is equivalent to calling with no scope, which is the existing behavior.
The scope key must consist only of [a-zA-Z0-9_.-] characters, with 1 <= length <= 36 chars.
the scope identifier
// Route a call into a named scope
await ingress.scope("tenant-123").serviceClient(MyService).process(payload);
// Idempotency keys are scoped — "req-1" in "tenant-123" is distinct from "req-1" in "tenant-456"
await ingress.scope("tenant-123").serviceClient(MyService)
.process(payload, rpc.opts({ idempotencyKey: "req-1" }));
// Combine with a limit key to enforce per-scope concurrency limits
await ingress.scope("tenant-123").workflowClient(MyWorkflow, "wf-key")
.run(input, rpc.opts({ limitKey: "api-key/user42" }));
Generic fire-and-forget send. Routes directly by service name without a typed definition.
Optionalkey?: stringOptionalopts?: SendOpts<I>Optional Experimentalscope?: stringRoute this send within the given scope. See Ingress.scope.
NOTE: This API is experimental. To use it you need a restate-server >= 1.7,
configured to enable
service protocol v7
and flow control.
For example, start the restate-server with the environment variables
RESTATE_EXPERIMENTAL_ENABLE_PROTOCOL_V7=true and RESTATE_EXPERIMENTAL_ENABLE_VQUEUES=true.
Create a client from a ServiceDefinition.
Create a client from a ServiceDefinition.
Create a client from a WorkflowDefinition.
the key of the workflow.
A remote client for a Restate service.
Use the following client to interact with services defined
serviceClientto create a client for a service.workflowClientto create a client for a workflow.objectClientto create a client for a virtual object.