{"record":{"id":"b1bfa553a25711db","repo":"microsoft/semantic-kernel","slug":"the-target-step-this-name-has-no-functions","errorCode":null,"errorMessage":"The target step {this.Name} has no functions.","messagePattern":"The target step (.+?) has no functions\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/ProcessStepBuilder.cs","lineNumber":175,"sourceCode":"    }\n\n    /// <summary>\n    /// Used to resolve the target function and parameter for a given optional function name and parameter name.\n    /// This is used to simplify the process of creating a <see cref=\"KernelProcessFunctionTarget\"/> by making it possible\n    /// to infer the function and/or parameter names from the function metadata if only one option exists.\n    /// </summary>\n    /// <param name=\"functionName\">The name of the function. May be null if only one function exists on the step.</param>\n    /// <param name=\"parameterName\">The name of the parameter. May be null if only one parameter exists on the function.</param>\n    /// <returns>A valid instance of <see cref=\"KernelProcessFunctionTarget\"/> for this step.</returns>\n    /// <exception cref=\"InvalidOperationException\"></exception>\n    internal virtual KernelProcessFunctionTarget ResolveFunctionTarget(string? functionName, string? parameterName)\n    {\n        string? verifiedFunctionName = functionName;\n        string? verifiedParameterName = parameterName;\n\n        if (this.FunctionsDict.Count == 0)\n        {\n            throw new KernelException($\"The target step {this.Name} has no functions.\");\n        }\n\n        // If the function name is null or whitespace, then there can only one function on the step\n        if (string.IsNullOrWhiteSpace(verifiedFunctionName))\n        {\n            if (this.FunctionsDict.Count > 1)\n            {\n                throw new KernelException(\"The target step has more than one function, so a function name must be provided.\");\n            }\n\n            verifiedFunctionName = this.FunctionsDict.Keys.First();\n        }\n\n        // Verify that the target function exists\n        if (!this.FunctionsDict.TryGetValue(verifiedFunctionName!, out var kernelFunctionMetadata) || kernelFunctionMetadata is null)\n        {\n            throw new KernelException($\"The function {functionName} does not exist on step {this.Name}\");\n        }","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/ProcessStepBuilder.cs#L157-L193","documentation":"Thrown by ProcessStepBuilder.ResolveFunctionTarget when FunctionsDict is empty — the target step has no kernel functions registered. This is the target-side equivalent of error 474, fired when resolving a function/parameter target for an edge destination.","triggerScenarios":"Wiring an edge to a step that has zero [KernelFunction] methods via SendEventTo or ProcessFunctionTargetBuilder. The target step's metadata shows no functions to route to.","commonSituations":"Targeting a state-only or marker step that has no kernel functions; the step class was meant to be used as a source (emit-only) but was wired as a destination; a step type was loaded whose methods lack the [KernelFunction] attribute.","solutions":["Ensure the target step class has at least one method decorated with [KernelFunction].","Verify the correct step type is being used as the edge target.","If the step is only a source, do not wire incoming edges to it — wire them to a step with an input function instead."],"exampleFix":"// before\npublic class SinkStep : KernelProcessStep { } // no kernel functions\nedge.SendEventTo(sinkStep.OnFunction(\"Receive\")); // throws\n\n// after\npublic class SinkStep : KernelProcessStep\n{\n    [KernelFunction]\n    public void Receive(string input) { }\n}\nedge.SendEventTo(sinkStep.OnFunction(\"Receive\"));","handlingStrategy":"validation","validationCode":"if (targetStep.FunctionsDict.Count == 0)\n    throw new InvalidOperationException(\n        $\"Target step '{targetStep.Name}' has no kernel functions. Cannot wire incoming edge.\");\n\nedge.SendEventTo(targetStep.OnFunction(\"Receive\"));","typeGuard":"bool IsValidTargetStep(ProcessStepBuilder step) => step.FunctionsDict.Count > 0;","tryCatchPattern":null,"preventionTips":["Ensure target steps have at least one [KernelFunction] method.","Don't wire incoming edges to state-only or source-only steps.","Validate target step function metadata during process construction."],"tags":["step-builder","kernel-function","function-target","dotnet"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}