Skip to content

Actor Invocation

This section is the formal reference for how a caller invokes an op on an actor. Read these pages when you are writing a transport, a gateway, an SDK, or a contract spec; the Overview section (Request/reply) covers the same material conceptually.

PageWhat it covers
Request envelopeThe MxEnvelope shape with every field, its purpose, and what is required vs optional.
Response envelopeSuccess replies — shape, op: '$reply', payload semantics.
Error envelopeErrors — shape, classification, the error field convention.
Correlation IDsHow CIDs are generated and scoped; relationship to NATS native _INBOX.*.
TimeoutsDefault 5000 ms, per-call override, classification of timeout errors.
Streaming / sessionsMulti-message exchanges layered over request/reply + events.

The two interaction shapes

Every actor invocation reduces to one of two shapes:

  1. Request/reply — one envelope in, one envelope out. Default timeout 5 s. The caller awaits a single response on a reply subject.
  2. Streaming session — one initiating envelope, then a stream of events (and optional follow-up requests) tagged by session ID. The actor decides when the session ends.

Pub/sub events without a request to anchor them are documented under Events, not here.

See also