Temporal Nexus implementation guidance for cross-namespace durable communication. Use when user asks about "nexus", "nexus operation", "nexus service", "nexus endpoint", "cross-namespace communication", "nexus caller", "nexus handler", "NexusClient", "ExecuteOperation", "WorkflowRunOperation", or "multi-namespace". Covers Go SDK (GA), with TypeScript/Python/Java in references. Do NOT use for architecture decisions about whether to adopt Nexus — use nexus-decision-guide instead.
From timelordnpx claudepluginhub therealbill/mynet --plugin timelordThis skill uses the workspace's default tool permissions.
references/nexus-multi-sdk.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Benchmarks web page Core Web Vitals/bundle sizes, API latency under load, build times; detects regressions via before/after PR comparisons.
Cross-namespace durable communication using Temporal Nexus (GA).
Nexus enables workflows in separate namespaces to call each other through typed service contracts with Temporal's full durable execution guarantees.
| Feature | Nexus | Child Workflows | Activities | Signals |
|---|---|---|---|---|
| Cross-namespace | Yes | No (same NS only) | No | No |
| Durable execution | Yes | Yes | No | N/A |
| Request-response | Yes | Yes | Yes | No (one-way) |
| Arbitrary duration | Yes | Yes | No (< 10s) | N/A |
| Loose coupling | Yes | No | Yes | N/A |
| Service contract | Typed interface | Parent-child | Implicit | N/A |
Architecture:
┌──────────────────┐ Nexus Endpoint ┌──────────────────┐
│ Caller Namespace │──────────────────>│ Handler Namespace │
│ ┌──────────────┐│ (routes to │┌────────────────┐│
│ │Caller Workflow││ target NS + ││Handler Worker ││
│ │ NexusClient ││ task queue) ││ NexusService ││
│ └──────────────┘│ │└────────────────┘│
└──────────────────┘ └──────────────────┘
Use Nexus when:
Don't use Nexus when:
| Requirement | Best Option |
|---|---|
| Same namespace, simple decomposition | Child Workflows |
| External side effects, no durability needed | Activities |
| One-way notification to running workflow | Signals |
| Synchronous state mutation | Updates |
| Cross-namespace, durable, request-response | Nexus |
| Cross-namespace, short request (< 10s) | Nexus sync operation |
| Cross-namespace, long-running process | Nexus async operation |
| SDK | Status | Notes |
|---|---|---|
| Go | GA | Full production support |
| Java | GA | Full production support (1.28.0+) |
| Python | Public Preview | Recommended for production, API may improve |
| TypeScript | Experimental | APIs may have breaking changes |
| .NET | Experimental | APIs may have breaking changes (1.9.0+) |
Nexus Endpoint: A cluster-level routing resource that maps a name to a target namespace + task queue. Decouples callers from handler location. Created via CLI or Terraform.
Nexus Service: A named collection of Nexus Operations. Defines the microservice contract. Registered on handler workers.
Nexus Operation: An arbitrary-duration operation — either:
Nexus Machinery: Temporal's built-in infrastructure providing at-least-once execution, automatic retries, circuit breaking, and rate limiting for Nexus calls.
Prerequisites: caller and handler namespaces must exist.
# Create namespaces (if not already present)
temporal operator namespace create --namespace handler-ns
temporal operator namespace create --namespace caller-ns
# Create Nexus endpoint
temporal operator nexus endpoint create \
--name my-endpoint \
--target-namespace handler-ns \
--target-task-queue handler-tq
# List endpoints
temporal operator nexus endpoint list
# Describe endpoint
temporal operator nexus endpoint describe --name my-endpoint
# Update endpoint
temporal operator nexus endpoint update \
--name my-endpoint \
--target-task-queue new-handler-tq
# Delete endpoint
temporal operator nexus endpoint delete --name my-endpoint
For requests completing in < 10 seconds:
import (
"context"
"github.com/nexus-rpc/sdk-go/nexus"
)
// Synchronous operation — returns result directly
var EchoOp = nexus.NewSyncOperation("echo",
func(ctx context.Context, input EchoInput, opts nexus.StartOperationOptions) (EchoOutput, error) {
return EchoOutput{Message: input.Message}, nil
})
For long-running processes:
import (
"context"
"go.temporal.io/sdk/client"
temporalnexus "go.temporal.io/sdk/temporalnexus"
)
// Async operation — starts a workflow, returns when workflow completes
var ProcessOrderOp = temporalnexus.NewWorkflowRunOperation("process-order",
ProcessOrderWorkflow,
func(ctx context.Context, input OrderInput, opts nexus.StartOperationOptions) (client.StartWorkflowOptions, error) {
return client.StartWorkflowOptions{
// Use RequestID as workflow ID to deduplicate retries
ID: opts.RequestID,
}, nil
})
import (
"github.com/nexus-rpc/sdk-go/nexus"
"go.temporal.io/sdk/worker"
)
// Create and register service
func registerNexusService(w worker.Worker) {
service := nexus.NewService("order-service")
service.Register(EchoOp)
service.Register(ProcessOrderOp)
w.RegisterNexusService(service)
}
For TypeScript (experimental), Python (public preview), and Java (GA) handler and caller examples, see references/nexus-multi-sdk.md.
func CallerWorkflow(ctx workflow.Context, input CallerInput) (*CallerOutput, error) {
// Create Nexus client — endpoint name + service name
nexusClient := workflow.NewNexusClient("my-endpoint", "order-service")
// Execute operation (blocks until result)
future := nexusClient.ExecuteOperation(ctx, ProcessOrderOp, OrderInput{
ID: input.OrderID,
}, workflow.NexusOperationOptions{
ScheduleToCloseTimeout: 10 * time.Minute,
})
var result OrderOutput
if err := future.Get(ctx, &result); err != nil {
return nil, fmt.Errorf("nexus operation failed: %w", err)
}
return &CallerOutput{OrderResult: result}, nil
}
| Error Type | Where | Description | Retryable? |
|---|---|---|---|
OperationError | Handler | Application-level failure | No |
HandlerError | Handler | Framework/infrastructure error | Depends on type |
NexusOperationFailure | Caller | Wraps handler error for caller workflow | No |
var result OrderOutput
if err := future.Get(ctx, &result); err != nil {
var nexusErr *temporal.NexusOperationFailure
if errors.As(err, &nexusErr) {
// Application-level failure from handler
logger.Error("Nexus operation failed", "error", nexusErr)
return nil, err
}
// Other errors (timeout, cancellation)
return nil, err
}
var ProcessOp = nexus.NewSyncOperation("process",
func(ctx context.Context, input Input, opts nexus.StartOperationOptions) (Output, error) {
if input.ID == "" {
// Return application error — caller gets NexusOperationFailure
return Output{}, nexus.HandlerErrorf(nexus.HandlerErrorTypeBadRequest, "ID is required")
}
return Output{Result: "ok"}, nil
})
Nexus-specific events in caller workflow history:
| Event | Meaning |
|---|---|
NexusOperationScheduled | Caller scheduled a Nexus operation |
NexusOperationStarted | Async operation accepted by handler (returned operation token) |
NexusOperationCompleted | Operation finished successfully |
NexusOperationFailed | Operation returned an error |
NexusOperationCanceled | Operation was canceled |
NexusOperationTimedOut | scheduleToCloseTimeout exceeded |
opts.RequestID as workflow ID in async handlers to safely handle retriesscheduleToCloseTimeout on caller side — without it, operations may hang indefinitelyFor detailed patterns, consult:
references/nexus-patterns.md - Advanced Nexus usage patternsreferences/nexus-multi-sdk.md - Multi-SDK implementation examples