{"record":{"id":"e0a0de8ec6c5d693","repo":"microsoft/semantic-kernel","slug":"the-process-named-this-name-does-not-expose-an","errorCode":null,"errorMessage":"The process named '{this.Name}' does not expose an event with Id '{eventId}'.","messagePattern":"The process named '(.+?)' does not expose an event with Id '(.+?)'\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/ProcessBuilder.cs","lineNumber":500,"sourceCode":"    /// <returns></returns>\n    internal ListenForBuilder ListenFor()\n    {\n        return new ListenForBuilder(this);\n    }\n\n    /// <summary>\n    /// Retrieves the target for a given external event. The step associated with the target is the process itself (this).\n    /// </summary>\n    /// <param name=\"eventId\">The Id of the event</param>\n    /// <returns>An instance of <see cref=\"ProcessFunctionTargetBuilder\"/></returns>\n    /// <exception cref=\"KernelException\"></exception>\n    public ProcessFunctionTargetBuilder WhereInputEventIs(string eventId)\n    {\n        Verify.NotNullOrWhiteSpace(eventId, nameof(eventId));\n\n        if (!this._externalEventTargetMap.TryGetValue(eventId, out var target))\n        {\n            throw new KernelException($\"The process named '{this.Name}' does not expose an event with Id '{eventId}'.\");\n        }\n\n        if (target is not ProcessFunctionTargetBuilder functionTargetBuilder)\n        {\n            throw new KernelException($\"The process named '{this.Name}' does not expose an event with Id '{eventId}'.\");\n        }\n\n        // Targets for external events on a process should be scoped to the process itself rather than the step inside the process.\n        var processTarget = functionTargetBuilder with { Step = this, TargetEventId = eventId };\n        return processTarget;\n    }\n\n    /// <summary>\n    /// Builds the process.\n    /// </summary>\n    /// <returns>An instance of <see cref=\"KernelProcess\"/></returns>\n    public KernelProcess Build(KernelProcessStateMetadata? stateMetadata = null)\n    {","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/ProcessBuilder.cs#L482-L518","documentation":"Thrown by ProcessBuilder.WhereInputEventIs when the given eventId is not found in the process's _externalEventTargetMap. This means the process has no step registered to receive an external event with that Id, so no target can be resolved.","triggerScenarios":"Calling process.WhereInputEventIs(\"myEvent\") before any step has been wired to respond to that event via OnInputEvent; using an event Id that was never registered; misspelling the event Id; calling WhereInputEventIs on a freshly constructed process with no edges defined.","commonSituations":"Defining a process and trying to reference an external event before building the edge graph; event Id mismatch between the publisher and the process definition; refactoring step names or event Ids and forgetting to update the external event reference.","solutions":["Ensure a step in the process has been wired to handle the event using process.OnInputEvent(eventId).SendEventTo(target) before calling WhereInputEventIs.","Verify the eventId string exactly matches the one used when registering the input event (case-sensitive).","Check that the step targeted by the event is added to the process before WhereInputEventIs is called."],"exampleFix":"// before\nvar target = process.WhereInputEventIs(\"StartEvent\"); // throws if no step registered for StartEvent\n\n// after — register the edge first\nprocess.OnInputEvent(\"StartEvent\").SendEventTo(myStep.WhereInputEventIs(\"input\"));\nvar target = process.WhereInputEventIs(\"StartEvent\");","handlingStrategy":"validation","validationCode":"var registeredEvents = process.GetExternalEvents(); // hypothetical or reflection\nif (!registeredEvents.Contains(eventId))\n    throw new InvalidOperationException(\n        $\"Event '{eventId}' is not registered. Call process.OnInputEvent(\\\"{eventId}\\\").SendEventTo(...) first.\");\n\nvar target = process.WhereInputEventIs(eventId);","typeGuard":null,"tryCatchPattern":"try\n{\n    var target = process.WhereInputEventIs(eventId);\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"does not expose an event\"))\n{\n    // Handle: event not registered — log and register or skip\n    logger.LogWarning(\"External event {EventId} not found on process\", eventId);\n}","preventionTips":["Register all external events (OnInputEvent + SendEventTo) before calling WhereInputEventIs.","Keep event Ids in constants to avoid typos and drift.","Build the complete edge graph before querying event targets."],"tags":["external-event","process-builder","edge-registration","dotnet"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}