OptionalconnectionPer-connection HTTP/2 flow-control window in bytes. Default 16 MiB (Node's 64 KiB default throttles aggregate throughput).
OptionalconnectDeadline for establishing the TCP connection and completing the TLS handshake. Default 5_000. Without it, a peer that accepts the connection but never completes TLS would stall reconnection indefinitely.
OptionaldrainHow long a draining connection may keep serving its in-flight invocations before being torn down. Default 120_000.
OptionalgracefulAutomatic graceful shutdown on process signals. On by default: the
engine installs a one-shot handler for each signal (default SIGTERM)
that calls shutdown(). If multiple connections in the same process
register for a signal, the shared process-level handler waits for all of
them before calling process.exit(0) once draining completes (or the
grace elapses) — so an operator-managed deployment gets
zero-dropped-invocation rollouts with no wiring. In Kubernetes, set
terminationGracePeriodSeconds to at least the drain grace plus the
handler slack you want to preserve. The handlers are removed when the
connection closes.
Pass false to opt out entirely — e.g. to manage signals and process
exit yourself and call shutdown() by hand. Pass an object to choose the
signals and grace, or true for the defaults.
OptionalhandshakeDeadline for the handshake with Restate Cloud. Default 5_000, mirroring the server's own handshake timeout.
OptionalmaxMaximum concurrent HTTP/2 streams (in-flight invocations) per connection. Default 4096 (Node's default of 100 is far too low for a deployment serving many concurrent invocations).
OptionalmaxNode http2 per-session memory cap in MiB. Default 256 (Node's 10 MiB default makes the session reject work under load).
OptionalpingLiveness watchdog: send an HTTP/2 PING every this many milliseconds. Default 75_000.
OptionalpingWatchdog: consecutive missed PINGs before the connection is declared dead and redialed. Default 2.
OptionalpingWatchdog: how long to wait for a PING ack. Default 10_000.
OptionalreconnectReconnect backoff policy: jittered exponential backoff applied between reconnect attempts (10ms → 120s by default), reset after a stable connection. See ReconnectRetryPolicy.
OptionalresolveHow often DNS SRV discovery re-resolves the server set. Default 30_000. (The Rust client re-resolves on DNS TTL expiry; Node does not expose record TTLs, so a fixed interval approximates it.) Ignored with explicit server addresses.
OptionalserversExplicit server addresses, instead of DNS discovery. Each entry is either
"host:port" (TLS governed by the tls option) or a URL
"https://host:port" / "http://host:port" (scheme selects TLS/plaintext
for that server). One connection per entry; the set is fixed (no
re-resolution). Private networks and tests.
At most one of serversSrv and servers may be set.
OptionalserversA DNS SRV name to discover the servers to connect to, instead of the one the connect key stands for. For environments with a custom domain; rarely set by hand. Servers are discovered via a DNS SRV lookup expanded to every resolved address — the engine holds one connection per resolved server and re-resolves every resolveIntervalMs, starting connections to servers that appear and tearing down connections to servers that vanish.
At most one of serversSrv and servers may be set.
OptionalsignalAbort to stop reconnecting and close the connection (same as close()).
OptionaltlsTLS for the outbound connection. Default true (system trust, SNI =
dialed host, ALPN h2). Pass false only for plaintext dev/test setups,
or an object for a private CA / mTLS.
OptionalworkerStable diagnostic identifier for this SDK worker/process. Restate Cloud can include it in routing and failure logs so operators can grep server-side events against SDK-side logs. Defaults to a hostname-based id with a short random suffix that is stable for this process. Advisory only: it is sent in the handshake for diagnostics, not used for authentication.
The ConnectOptions.connection tuning: server discovery, the worker id, reconnect and drain behaviour, HTTP/2 limits, TLS. Every option has a default that fits Restate Cloud; most deployments set none of them.