Skip to content

Updated for Nexus SDK Ergonomics - Not ready to be merged yet!! - #5203

Open
Evanthx wants to merge 9 commits into
mainfrom
nexus-v2-2
Open

Updated for Nexus SDK Ergonomics - Not ready to be merged yet!!#5203
Evanthx wants to merge 9 commits into
mainfrom
nexus-v2-2

Conversation

@Evanthx

@Evanthx Evanthx commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

This adds and updates some information about Nexus SDK ergonomics.
Dev Experience page replaces the Nexus feature guide.

@Evanthx
Evanthx requested a review from a team as a code owner August 29, 2026 03:50
Copilot AI balanced review requested due to automatic review settings August 29, 2026 03:50
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Sep 4, 2026 10:09pm UTC

Request Review

@Evanthx Evanthx added the do-not-merge What it says on the label label Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Java guide duplicates existing documentation, lacks a runnable generated-contract setup, and leaves related Nexus pages inconsistent.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds prerelease Nexus SDK ergonomics documentation and a Java implementation guide.

Changes:

  • Documents the unified Temporal Operation Handler, code generation, and Activity-backed Operations.
  • Adds a Java prerelease developer guide.
  • Adds the new pages to Nexus navigation.
File summaries
File Description
sidebars.js Registers and groups the new pages.
docs/encyclopedia/nexus/temporal-operation-handler.mdx Explains the unified handler API.
docs/encyclopedia/nexus/nexus-standalone-activity.mdx Describes Activity-backed Operations.
docs/encyclopedia/nexus/nexus-code-generator.mdx Introduces generated Nexus contracts.
docs/develop/java/nexus/developer-experience.mdx Provides Java usage and deployment guidance.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/develop/java/nexus/developer-experience.mdx Outdated
APIs are experimental and may be subject to backwards-incompatible changes.
</ReleaseNoteHeader>

Temporal has unified the Workflow handler and the synchronous operation handler into a single handler, and added the ability to back an Operation with a [Standalone Activity](/nexus/standalone-activity).
Comment on lines +19 to +20
The Nexus Code Generator, [`nexgen`](https://github.com/temporalio/nex-gen), turns one schema into client code for Go, Java, Python, and TypeScript.
Both sides of a [Nexus Service](/nexus/services) generate from the same file, so neither hand-writes the types and neither can drift from the contract.
Comment on lines +95 to +97
You can hand-write that package, but the preferred way is to generate it with the [Nexus Code Generator](https://github.com/temporalio/nex-gen).
You write the contract once as a JSON definition file and run `nexgen` against it, and it emits the typed models,
runtime validators, and the Service definition itself.
@jsundai

jsundai commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Taking a quick look at this. Will do a deeper look this week.


import { ReleaseNoteHeader } from '@site/src/components';

<ReleaseNoteHeader type="prerelease" languages={["Go", "Java", "Python", "TypeScript"]}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need links on the logos just to be consistent - but this is something I can do.

APIs are experimental and may be subject to backwards-incompatible changes.
</ReleaseNoteHeader>

The Nexus Code Generator, [`nexgen`](https://github.com/temporalio/nex-gen), turns one schema into client code for Go, Java, Python, and TypeScript.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Nexus Code Generator might bring traffic from people who might be unfamiliar with Nexus, I'm wondering if this needs a very basic intro sentence on what a nexus code generator is for users.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also starting off with why use a Nexus Code Generator could be helpful as an intro.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I reworked that paragraph. See if you like this better!

@CLAassistant

CLAassistant commented Sep 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread docs/encyclopedia/nexus/nexus-code-generator.mdx
APIs are experimental and may be subject to backwards-incompatible changes.
</ReleaseNoteHeader>

:::note Not the same as a Standalone Nexus Operation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try not to stack admonitions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this is about the release note and the note coming one right after the other - the release note will go away as soon as this comes out of pre-release, and the note I added to address something that I found very confusing so I thought needed to be clarified. I would like to defend this one, especially since the release note will be getting removed as soon as this comes out of pre-release.

@Evanthx
Evanthx requested review from jsundai and a balanced review from Copilot September 2, 2026 17:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new guides duplicate existing feature guides, omit collateral updates, and incorrectly claim .NET code-generation support.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

docs/develop/java/nexus/developer-experience.mdx:4

  • This creates a second full Nexus feature guide beside docs/develop/java/nexus/feature-guide.mdx; 602 of this page's 696 lines duplicate that guide. The documented SDK structure defines Nexus as a Quickstart plus one feature guide (readme/INFORMATION-ARCHITECTURE.md:150-151). Merge the ergonomics updates into the existing feature guide instead of publishing parallel guides that can drift.
title: Nexus Developer Experience - Java SDK feature guide

docs/encyclopedia/nexus/temporal-operation-handler.mdx:19

  • The parent and lifecycle pages still describe the old handler model: docs/encyclopedia/nexus/nexus.mdx:50-55 says asynchronous Operations only start Workflows and treats Updates as synchronous, while docs/encyclopedia/nexus/nexus-operations.mdx:16,36-39 still documents Workflow-backed async and separate New-Workflow-Run-Operation/New-Sync-Operation builders. Update those pages alongside this unified handler so readers do not get conflicting definitions of async backings and handler APIs.
Temporal has unified the Workflow handler and the synchronous operation handler into a single handler, and added the ability to back an Operation with a [Standalone Activity](/nexus/standalone-activity).
  • Files reviewed: 9/9 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment on lines +96 to +110
You can hand-write that package, but the preferred way is to generate it with the [Nexus Code Generator](https://github.com/temporalio/nex-gen).
You write the contract once as a JSON definition file and run `nexgen` against it, and it emits the typed models,
runtime validators, and the Service definition itself.

This is what makes a Nexus Service polyglot. Both sides generate from the same definition file: the handler implements
the Service, the caller invokes its Operations, and neither hand-writes a request or response type. A Python handler
and a Go caller share no code, but they both run off that same service contract - so they interoperate with no
coordination between the teams beyond the contract itself.

The generated validators check every payload against the contract, when a value is parsed off the wire and again when
it is serialized onto it, so bad data is rejected at the boundary rather than reaching your Workflow. A value validates
identically in every language, which is what lets a caller and a handler written in different languages trust the same
contract. See the [`chat.nexusrpc.yaml`](https://github.com/temporalio/nex-gen/blob/main/samples/schemas/chat.nexusrpc.yaml)
sample contract and the [Definition files](https://github.com/temporalio/nex-gen#definition-files) section of the
`nexgen` README for the file format.
---
id: developer-experience
slug: /develop/dotnet/nexus/developer-experience
title: Nexus Developer Experience - .NET SDK feature guide
---
id: developer-experience
slug: /develop/go/nexus/developer-experience
title: Nexus Developer Experience - Go SDK feature guide
---
id: developer-experience
slug: /develop/python/nexus/developer-experience
title: Nexus Developer Experience - Python SDK feature guide
---
id: developer-experience
slug: /develop/typescript/nexus/developer-experience
title: Nexus Developer Experience - TypeScript SDK feature guide
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

✅ Docs build passed

@jsundai

jsundai commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Let's keep the feature guide as the title for now. The content of the dev experience page should all still be there since it's folded into the page but we can keep the feature page metadata - this also avoids changing all the redirects/urls. I added a callout that there's a new developer experience. Going to make a few more edits.

@bergundy bergundy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started reviewing the whole guide and stopped myself. I am debating whether to spend time on that or not. The nexgen docs were fully reviewed.


:::note

This Feature Guide includes the new Nexus developer experience: pre-release APIs for the [Temporal Operation Handler](/nexus/temporal-operation-handler) and [Nexus Standalone Activity](/nexus/standalone-activity). These APIs are experimental and may change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should call this feature "Nexus standalone activity", but you can say that this guide covers invoking a standalone activity from a nexus handler.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would say "subject to change".

Handlers should be reliable since the [circuit breaker](/nexus/operations#circuit-breaking) trips after 5 consecutive retryable errors, blocking all Operations from the caller to that Endpoint.

The `Temporalio.Nexus` namespace has utilities to help create Nexus Operations:
Every Operation is written with [`TemporalOperationHandler`](/nexus/temporal-operation-handler). Mark a method

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this statement is confusing. We don't show the TemporalOperationHandler just the shorthand TemporalOperation.


The `Temporalio.Nexus` namespace has utilities to help create Nexus Operations:
Every Operation is written with [`TemporalOperationHandler`](/nexus/temporal-operation-handler). Mark a method
`[TemporalOperation]` and the method body itself becomes the start handler, receiving three things: a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would try to avoid using terminology like "start handler", it's better to say "operation handler" IMHO and just ignore the details of start and cancel.

Comment on lines +4 to +5
sidebar_label: Nexus Code Generator
description: The Nexus Code Generator turns one schema into typed models, runtime validators, and Nexus Service definitions for Go, Java, Python, and TypeScript.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this nexgen to match the language everywhere?
Same goes for the name of the file.

APIs are experimental and may be subject to backwards-incompatible changes.
</ReleaseNoteHeader>

A [Nexus Service](/nexus/services) is called across a team boundary, often by a caller written in a different language and deployed on its own schedule.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super clear to me what it's different from.

Suggested change
A [Nexus Service](/nexus/services) is called across a team boundary, often by a caller written in a different language and deployed on its own schedule.
A [Nexus Service](/nexus/services) is called across a team boundary, often by a caller written in a different language than the handler implementation and deployed on its own schedule.

## How it works

You write the contract once, as a JSON definition file, and run `nexgen` against it.
The generator emits client code in Go, Java, Python, or TypeScript.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The generator emits client code in Go, Java, Python, or TypeScript.
The generator emits contract code in Go, Java, Python, or TypeScript as requested.

## Data validation

The generated validators check every payload against the contract, when a value is parsed off the wire and again when it is serialized onto it.
Bad data is rejected at the boundary instead of reaching your Workflow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Bad data is rejected at the boundary instead of reaching your Workflow.
Bad data is rejected at the boundary instead of reaching your Workflow or Activity.

The generated validators check every payload against the contract, when a value is parsed off the wire and again when it is serialized onto it.
Bad data is rejected at the boundary instead of reaching your Workflow.

Failures aggregate into a single error listing every violation, each naming the offending field and the bound it broke.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Failures aggregate into a single error listing every violation, each naming the offending field and the bound it broke.
Failures aggregate into a single error listing every violation, each naming the offending field and the constraint it broke.

Bad data is rejected at the boundary instead of reaching your Workflow.

Failures aggregate into a single error listing every violation, each naming the offending field and the bound it broke.
A handler maps that to a `BAD_REQUEST` [Nexus error](/nexus/error-handling), so a malformed request tells the caller everything that was wrong in one response.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A handler maps that to a `BAD_REQUEST` [Nexus error](/nexus/error-handling), so a malformed request tells the caller everything that was wrong in one response.
A handler maps that to a `BAD_REQUEST` [Nexus handler error](/nexus/error-handling), so a malformed request tells the caller everything that was wrong in one response.

A handler maps that to a `BAD_REQUEST` [Nexus error](/nexus/error-handling), so a malformed request tells the caller everything that was wrong in one response.

A value is validated identically in every language, which is what lets a caller and a handler written in different ones trust the same contract.
Keeping that promise is why the supported schema subset is deliberately strict: anything ambiguous, or anything that cannot be expressed the same way everywhere, is rejected at generation time rather than becoming code that validates differently in one language than another.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd maybe note the few documented cross language inconsistencies: https://github.com/temporalio/nexgen#known-cross-language-divergences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge What it says on the label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants