From 5c6634d4f793eb77cf27dccfc78fade78f6344c1 Mon Sep 17 00:00:00 2001 From: Evan Reynolds Date: Wed, 22 Jul 2026 15:04:26 -0700 Subject: [PATCH] Moving a new method from SDK go's link_converter into this shared link converter --- temporalnexus/link_converter.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/temporalnexus/link_converter.go b/temporalnexus/link_converter.go index 7b3cfb2b..b5990a5b 100644 --- a/temporalnexus/link_converter.go +++ b/temporalnexus/link_converter.go @@ -103,6 +103,25 @@ func ConvertLinkWorkflowEventToNexusLink(we *commonpb.Link_WorkflowEvent) nexus. } } +// ConvertWorkflowLinkToNexusLink converts a Link_Workflow into a Nexus Link. +// +// NOTE: Experimental +func ConvertWorkflowLinkToNexusLink(wl *commonpb.Link_Workflow) nexus.Link { + return nexus.Link{ + URL: &url.URL{ + Scheme: urlSchemeTemporalKey, + Path: fmt.Sprintf(urlPathWorkflowEventTemplate, wl.GetNamespace(), wl.GetWorkflowId(), wl.GetRunId()), + RawPath: fmt.Sprintf( + urlPathWorkflowEventTemplate, + url.PathEscape(wl.GetNamespace()), + url.PathEscape(wl.GetWorkflowId()), + url.PathEscape(wl.GetRunId()), + ), + }, + Type: string(wl.ProtoReflect().Descriptor().FullName()), + } +} + // ConvertNexusLinkToLinkWorkflowEvent converts a Nexus Link to Link_WorkflowEvent. // // NOTE: Experimental