Skip to content

Add Nexus-based compute providers for worker invocation and scaling - #74

Draft
02strich wants to merge 1 commit into
mainfrom
stefan/custom
Draft

02strich wants to merge 1 commit into
mainfrom
stefan/custom

Conversation

@02strich

@02strich 02strich commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Introduce a Nexus RPC compute providers for invoke and worker-set compute providers.

As the Nexus-based compute providers are called directly from the workflow, adding a new code path to the Workflow to do that - and fallback to activity when another compute provider is used. Also backfilling the so far missing field for the Nexus endpoint - which already existed in the frontend API.

Add a cmd/nexus-subprocess-example binary demonstrating a subprocess-backed Nexus invoke service, along with Makefile targets and .gitignore entries for the generated files and new binary.

@02strich
02strich force-pushed the stefan/custom branch 14 times, most recently from bb3368d to 3e50a59 Compare July 7, 2026 20:03
Introduce a Nexus RPC compute providers for invoke and worker-set compute providers.

As the Nexus-based compute providers are called directly from the workflow, adding a new code path to the Workflow to do that - and fallback to activity when another compute provider is used. Also backfilling the so far missing field for the Nexus endpoint - which already existed in the frontend API.

Add a cmd/nexus-subprocess-example binary demonstrating a subprocess-backed Nexus invoke service, along with Makefile targets and .gitignore entries for the generated files and new binary.

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 call out in a comment that this is temporary until we add generate language friendly types with nexgen.

fatalf("--out-file is required")
}
if flag.NArg() != 1 {
fatalf("expected one .nexusrpc.yaml input file")

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.

You shouldn't need a nexusrpc.yaml for proto based definitions.

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.

This should all be handled by nexgen.

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.

You should be able to avoid copying this definition into your repo. I think you should define all of your protos in the api repo.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was wondering about that - given it's a user facing API that seems fitting. I'll see to move them over there

Comment on lines +9 to +10
//go:generate npx --yes nexus-rpc-gen@0.1.0-alpha.4 --lang go --package nexus --out-file nexus_invoke_nexusrpc_gen.go nexus_invoke.nexusrpc.yaml
//go:generate npx --yes nexus-rpc-gen@0.1.0-alpha.4 --lang go --package nexus --out-file nexus_worker_set_nexusrpc_gen.go nexus_worker_set.nexusrpc.yaml

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.

nexus-rpc-gen is deprecated. We should sync up on this.


var newNexusWorkerSetWorkflowClientFn = workflow.NewNexusClient

var executeNexusWorkerSetValidateConfigOperationFn = func(

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.

There's a plan to generate client methods in nexgen too, which will save you from creating these wrappers.

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.

2 participants