Skip to main content

Nexus Services

SUPPORT, STABILITY, and DEPENDENCY INFO

Temporal Nexus is available in Public Preview for Temporal Cloud and self-hosted deployments.

Nexus Services are named collections of arbitrary-duration Nexus Operations that provide a contract suitable for sharing across team boundaries.

Nexus Security

A Nexus Endpoint exposes Nexus Services for others to use. Services are handled in a Temporal Worker that is polling an Endpoint's target Namespace and Task Queue. Multiple Nexus Services may be run in the same Worker polling the same Endpoint target Namespace and Task Queue.

For example, a Nexus Service is often registered in the same Worker as the underlying Workflows they abstract:

func main() {
c, err := client.Dial(client.Options{})
if err != nil {
log.Fatalln("Unable to create client", err)
}
defer c.Close()

w := worker.New(c, taskQueue, worker.Options{})
service := nexus.NewService(service.HelloServiceName)
err = service.Register(handler.EchoOperation, handler.HelloOperation)
if err != nil {
log.Fatalln("Unable to register operations", err)
}
w.RegisterNexusService(service)
w.RegisterWorkflow(handler.HelloHandlerWorkflow)

err = w.Run(worker.InterruptCh())
if err != nil {
log.Fatalln("Unable to start worker", err)
}
}

The Nexus Service name is used when invoking a Nexus Operation from a caller workflow.