Add workflow.SignalWithStartWorkflow via system Nexus#2416
Draft
dplyukhin wants to merge 20 commits into
Draft
Conversation
tconley1428
reviewed
Jun 24, 2026
| @@ -0,0 +1,33 @@ | |||
| # Regenerates the system Nexus client bindings (api.go, model_overrides.go) and | |||
There was a problem hiding this comment.
I think we just want it as part of the root make file.
tconley1428
reviewed
Jun 24, 2026
tconley1428
reviewed
Jun 24, 2026
tconley1428
reviewed
Jun 24, 2026
07bf3e3 to
7257e80
Compare
Generate Go bindings for the system Nexus WorkflowService from a checked-in WIT and re-expose SignalWithStartWorkflow on the workflow package. The nex-gen-generated api.go targets the public workflow/temporal/client packages, which all depend on internal; a generated package re-exported by workflow would form an import cycle. internal/cmd/nexussystemgen runs nex-gen and rewrites the output (via the Go AST) to target go.temporal.io/sdk/internal directly, emitting internal/nexussystem and the generated workflow/system_nexus_gen.go forwarder. The resulting graph (workflow -> internal/nexussystem -> internal, and workflow -> internal) is acyclic. The request is serialized proto-binary into the Nexus operation Input; api-go's payload visitor descends into the envelope's inner payloads (codecs/external storage apply to the inner payloads, not the envelope). NewNexusClient now permits the system endpoint/service pair despite the reserved __temporal_ prefix. internal/extstore moves off the vendored internal/temporalapi/sdk/v1 to go.temporal.io/api/sdk/v1, which now publishes ExternalStorageReference; this avoids a duplicate proto-registration panic against the updated api-go. NOTE: includes a temporary 'replace go.temporal.io/api => ../temporal-api-go' pending a release of the api-go payload-visitor change.
The api-go payload visitor decodes system Nexus envelopes from the payload's "messageType" metadata and requires binary/protobuf encoding. The default data converter encodes proto messages as json/protobuf, so explicitly encode the system Nexus envelope with the proto (binary) converter in prepareNexusOperationParams when the client targets the system endpoint. The envelope is not run through the workflow data converter or any codec; the inner payloads are handled by api-go's visitor.
Update Go version to 1.25.4, update dependencies including go.temporal.io/api to v1.63.1-0.20260630215314-778d41d2e499, and add nexus-proto-annotations dependency. Also wrap defer statements to suppress unused error results from Close and RemoveAll calls.
b03cbaa to
6a76a7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
workflow.SignalWithStartWorkflow, backed by the built-in system NexusWorkflowService. The bindings are generated by nex-gen from a checked-in WIT and
re-exposed on the
workflowpackage.How
The nex-gen-generated
api.gotargets the publicworkflow/temporal/clientpackages, all of which depend on
internal. A generated package re-exported byworkflowwould form an import cycle (workflow -> generated -> workflow).internal/cmd/nexussystemgenruns nex-gen and rewrites the output via the GoAST to target
go.temporal.io/sdk/internaldirectly (the public packages arethin aliases of internal, so this is identity-preserving), emitting
internal/nexussystemand the generatedworkflow/system_nexus_gen.goforwarder. The resulting graph (
workflow -> internal/nexussystem -> internal,and
workflow -> internal) is acyclic.For the system endpoint,
prepareNexusOperationParamsencodes the envelope asproto-binary (via the proto payload converter) rather than through the
workflow data converter — the default converter would produce
json/protobuf,but temporal-api-go's visitor requires
binary/protobufand reads themessageTypemetadata to decode it. The envelope is not run through any codec;api-go's visitor descends into the envelope's inner payloads so codecs / external
storage apply there.
NewNexusClientnow permits the system endpoint/servicepair despite the reserved
__temporal_prefix.internal/extstoremoves off the vendoredinternal/temporalapi/sdk/v1togo.temporal.io/api/sdk/v1, which now publishesExternalStorageReference(perthat vendored package's own README migration note); this avoids a duplicate
proto-registration panic against the updated api-go.
Dependencies
This branch includes
replace go.temporal.io/api => ../temporal-api-goso it canbuild against the unreleased api-go visitor change. This must be removed and
replaced with a released
go.temporal.io/apiversion before merge.Test plan
go build ./...go test ./internal/...(full internal suite, plusinternal/extstore,internal/nexussystem)internal/nexussystem/system_nexus_integration_test.go(end-to-end: request -> proto-binary envelope -> api-go visitor descends
into inner payloads) and
internal/system_nexus_client_test.go(NewNexusClient system-pair exemption)
Regeneration
NEX_GEN_BIN=<bin> DESCRIPTORS=<set.pb> make -C internal/nexussystem generate