Skip to content

fix(typescript): build the returned resource on the System Nexus path - #267

Merged
moetemp merged 6 commits into
temporalio:mainfrom
moetemp:moe/up/ts-system-nexus-resource-return
Oct 25, 2026
Merged

moetemp merged 6 commits into
temporalio:mainfrom
moetemp:moe/up/ts-system-nexus-resource-return

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR makes a TypeScript System Nexus operation that returns a resource build the resource from the answer, as the endpoint path does.

Why?

The answer is the resource's wire message. The cast compiled, but a resource method call on the result failed at run time.

How did you test it?

A new workflow-handle sample, for TypeScript, Python and .NET. Its TypeScript start-workflow.ts returned result as WorkflowHandle and now returns new WorkflowHandle(...), as Python and .NET already do. The .NET sample build leaves it out, as it does multi-operation-service, because two System Nexus samples define the same helper types.

@moetemp
moetemp requested a review from a team as a code owner October 22, 2026 20:00
@moetemp moetemp changed the title fix: build the returned resource on the TypeScript System Nexus path fix(typescript): build the returned resource on the System Nexus path Oct 22, 2026
@CLAassistant

CLAassistant commented Oct 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread advanced/samples/inputs/examples.toml Outdated
[notification-service]
languages = ["python", "dotnet", "typescript"]

[start-workflow]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This doesn't make a lot of sense. Why are we running start-workflow as system nexus on TS only? start-workflow was never really intended as a system nexus example.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It does sound like you need a system nexus + resource sample, but converting this one just in TS is strange. I think you need a new one, which can run only in TS if it only works in TS for now.

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.

Agreed, that was the wrong sample to use. I put start-workflow back the way it was and added a small workflow-handle sample in 2c3a911. It's just a System Nexus start-workflow operation that returns a workflow-handle resource. In bf84b7c it also generates for Python and .NET, which already build the resource. On main its TypeScript output is return result as WorkflowHandle;, and with this PR it's return new WorkflowHandle(...). That also let me drop the system_nexus_languages option, so examples.toml just gets the new table.

@moetemp
moetemp marked this pull request as draft October 22, 2026 22:29
@moetemp
moetemp changed the base branch from main to moe/up/stream-service-sample October 23, 2026 04:04
@moetemp
moetemp force-pushed the moe/up/ts-system-nexus-resource-return branch from 4ec6f17 to d9b9b23 Compare October 23, 2026 04:18
@moetemp
moetemp changed the base branch from moe/up/stream-service-sample to main October 23, 2026 04:19
@moetemp
moetemp requested a review from tconley1428 October 23, 2026 04:23
@moetemp
moetemp marked this pull request as ready for review October 23, 2026 04:46

@tconley1428 tconley1428 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not part of this one, but I wonder if we should start grouping system nexus examples.

@tconley1428
tconley1428 force-pushed the moe/up/ts-system-nexus-resource-return branch from d9b9b23 to b6ecace Compare October 23, 2026 20:01
@moetemp
moetemp merged commit d228648 into temporalio:main Oct 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants