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