{"record":{"id":"2fe9b0a1c62d3e0a","repo":"microsoft/semantic-kernel","slug":"topic-name-topicname-is-not-registered-as-proxy","errorCode":null,"errorMessage":"Topic name {topicName} is not registered as proxy publish event, register first before using","messagePattern":"Topic name (.+?) is not registered as proxy publish event, register first before using","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/ProcessProxyBuilder.cs","lineNumber":55,"sourceCode":"    /// </summary>\n    public string Version { get; init; } = \"v1\";\n\n    internal readonly Dictionary<string, bool> _externalTopicUsage;\n\n    // 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        }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/ProcessProxyBuilder.cs#L37-L73","documentation":"Thrown by ProcessProxyBuilder.LinkTopicToStepEdgeInfo when the given topicName is not found in _externalTopicUsage, meaning it was never registered as a proxy publish topic during construction. You must register a topic before linking a step edge to it.","triggerScenarios":"Calling LinkTopicToStepEdgeInfo with a topicName that was not in the externalTopics list passed to the ProcessProxyBuilder constructor; typo in the topic name; using a topic from a different proxy step.","commonSituations":"Hardcoding topic names that drift from the ones registered at proxy construction; refactoring topic names in one place but not the other; copy-pasting proxy configuration and not updating all references.","solutions":["Ensure the topicName passed to LinkTopicToStepEdgeInfo exactly matches one of the topics in the externalTopics list used to construct the proxy.","Maintain topic names as constants or a shared configuration to avoid drift.","Validate the topic exists in the proxy's registered topics before calling LinkTopicToStepEdgeInfo."],"exampleFix":"// before\nvar proxy = process.AddProxyStep(\"myProxy\", externalTopics: new[] { \"topicA\", \"topicB\" });\nproxy.LinkTopicToStepEdgeInfo(\"topicC\", sourceStep, eventData); // throws — topicC not registered\n\n// after\nproxy.LinkTopicToStepEdgeInfo(\"topicA\", sourceStep, eventData);","handlingStrategy":"validation","validationCode":"if (!registeredTopics.Contains(topicName))\n    throw new InvalidOperationException(\n        $\"Topic '{topicName}' is not registered. Registered topics: {string.Join(\", \", registeredTopics)}\");\n\nproxy.LinkTopicToStepEdgeInfo(topicName, sourceStep, eventData);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep registered topic names in a shared constant or config to avoid drift.","Validate the topic exists in the proxy's registered set before linking.","Use consistent naming conventions for topics across the codebase."],"tags":["proxy-step","topic-registration","edge-linking","dotnet"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}