{"record":{"id":"08a70c0778bf0fef","repo":"microsoft/semantic-kernel","slug":"topic-name-topicname-is-is-already-linked-to-ano","errorCode":null,"errorMessage":"Topic name {topicName} is is already linked to another step edge","messagePattern":"Topic name (.+?) is is already linked to another step edge","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/ProcessProxyBuilder.cs","lineNumber":60,"sourceCode":"    // For supporting multiple step edges getting linked to the same external topic, current implementation needs to be updated\n    // to instead have a list of potential edges in case event names in different steps have same name\n    internal readonly Dictionary<string, KernelProcessProxyEventMetadata> _eventMetadata = [];\n\n    internal ProcessFunctionTargetBuilder GetExternalFunctionTargetBuilder()\n    {\n        return new ProcessFunctionTargetBuilder(this, functionName: KernelProxyStep.ProcessFunctions.EmitExternalEvent, parameterName: \"proxyEvent\");\n    }\n\n    internal void LinkTopicToStepEdgeInfo(string topicName, ProcessStepBuilder sourceStep, ProcessEventData eventData)\n    {\n        if (!this._externalTopicUsage.TryGetValue(topicName, out bool usedTopic))\n        {\n            throw new InvalidOperationException($\"Topic name {topicName} is not registered as proxy publish event, register first before using\");\n        }\n\n        if (usedTopic)\n        {\n            throw new InvalidOperationException($\"Topic name {topicName} is is already linked to another step edge\");\n        }\n\n        this._eventMetadata[eventData.EventName] = new() { EventId = eventData.EventId, TopicName = topicName };\n        this._externalTopicUsage[topicName] = true;\n    }\n\n    /// <inheritdoc/>\n    internal override KernelProcessStepInfo BuildStep(ProcessBuilder processBuilder, KernelProcessStepStateMetadata? stateMetadata = null)\n    {\n        if (this._externalTopicUsage.All(topic => !topic.Value))\n        {\n            throw new InvalidOperationException(\"Proxy step does not have linked steps to it, link step edges to proxy or remove proxy step\");\n        }\n\n        KernelProcessProxyStateMetadata proxyMetadata = new()\n        {\n            Name = this.Name,\n            Id = this.Id,","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/ProcessProxyBuilder.cs#L42-L78","documentation":"Thrown by ProcessProxyBuilder.LinkTopicToStepEdgeInfo when the topicName is registered but already marked as used (usedTopic is true). Each topic can only be linked to one step edge in the current implementation. Note the message contains a typo (\"is is already\").","triggerScenarios":"Calling LinkTopicToStepEdgeInfo twice with the same topicName on the same proxy step; attempting to link two different step edges to the same external topic.","commonSituations":"Two steps in the process both try to publish to the same external topic; a loop or configuration-driven edge-creation inadvertently links the same topic multiple times; misunderstanding that the current implementation supports only one edge per topic.","solutions":["Ensure each topic is linked to exactly one step edge per proxy step.","If multiple steps need to publish to the same logical topic, create separate proxy steps or register additional distinct topic names.","Check the comment in the source: the implementation needs updating to support a list of edges per topic if multi-linking is required."],"exampleFix":"// before\nproxy.LinkTopicToStepEdgeInfo(\"topicA\", step1, eventData1);\nproxy.LinkTopicToStepEdgeInfo(\"topicA\", step2, eventData2); // throws — topicA already used\n\n// after — use distinct topics for each edge\nproxy = process.AddProxyStep(\"myProxy\", externalTopics: new[] { \"topicA\", \"topicB\" });\nproxy.LinkTopicToStepEdgeInfo(\"topicA\", step1, eventData1);\nproxy.LinkTopicToStepEdgeInfo(\"topicB\", step2, eventData2);","handlingStrategy":"validation","validationCode":"// Check if topic is already linked before calling LinkTopicToStepEdgeInfo\n// (requires internal access to _externalTopicUsage; if not available, track externally)\nif (linkedTopics.Contains(topicName))\n    throw new InvalidOperationException($\"Topic '{topicName}' is already linked to a step edge.\");\n\nproxy.LinkTopicToStepEdgeInfo(topicName, sourceStep, eventData);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember that each topic can only link to one step edge in the current implementation.","Register distinct topics if multiple steps need to publish externally.","Track which topics have been linked to detect accidental double-linking."],"tags":["proxy-step","single-link-per-topic","edge-linking","dotnet"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}