microsoft/semantic-kernel · error · InvalidOperationException

No targets found for the specified function and parameter '{

Error message

No targets found for the specified function and parameter '{functionName}.{parameterName}'.

What it means

Thrown by ProcessBuilder.ResolveFunctionTarget when none of the registered entry-point steps can resolve the requested functionName.parameterName combination. The method tries each entry step and collects KernelExceptions silently, then throws InvalidOperationException if zero targets matched.

Source

Thrown at dotnet/src/Experimental/Process.Core/ProcessBuilder.cs:98

    {
        // Try to resolve the function target on each of the registered entry points.
        var targets = new List<KernelProcessFunctionTarget>();
        foreach (var step in this._entrySteps)
        {
            try
            {
                targets.Add(step.ResolveFunctionTarget(functionName, parameterName));
            }
            catch (KernelException)
            {
                // If the function is not found on the source step, then we can ignore it.
            }
        }

        // If no targets were found or if multiple targets were found, throw an exception.
        if (targets.Count == 0)
        {
            throw new InvalidOperationException($"No targets found for the specified function and parameter '{functionName}.{parameterName}'.");
        }
        else if (targets.Count > 1)
        {
            throw new InvalidOperationException($"Multiple targets found for the specified function and parameter '{functionName}.{parameterName}'.");
        }

        return targets[0];
    }

    /// <inheritdoc/>
    internal override void LinkTo(string eventId, ProcessStepEdgeBuilder edgeBuilder)
    {
        Verify.NotNull(edgeBuilder?.Source, nameof(edgeBuilder.Source));
        Verify.NotNull(edgeBuilder?.Target, nameof(edgeBuilder.Target));

        // Keep track of the entry point steps
        this._entrySteps.Add(edgeBuilder.Source);
        this._externalEventTargetMap[eventId] = edgeBuilder.Target;

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Verify that the functionName exists as a [KernelFunction] on at least one entry-point step in the process.
  2. Verify that the parameterName matches a parameter on that function, or omit it if the function has exactly one parameter.
  3. Ensure the target step is registered as an entry point (linked via OnInputEvent or as a source step that feeds into the process).
  4. If using auto-inference (null names), make sure exactly one function/parameter exists on the entry step.

Example fix

// before — misspelled function name
step.SendEventTo(process.WhereInputEventIs("StartProces")); // typo — throws

// after
step.SendEventTo(process.WhereInputEventIs("StartProcess"));
Defensive patterns

Strategy: validation

Validate before calling

// Before resolving, verify the function exists on at least one entry step.
public bool FunctionExists(ProcessBuilder process, string? functionName, string? parameterName)
{
    foreach (var step in process.Steps)
    {
        try
        {
            step.ResolveFunctionTarget(functionName, parameterName);
            return true;
        }
        catch { /* not found on this step */ }
    }
    return false;
}

Prevention

When it happens

Trigger: Calling ResolveFunctionTarget with a functionName or parameterName that does not exist on any entry-point step in the process. This occurs when linking edges to a process (as a sub-process step) using incorrect or misspelled function/parameter names, or when the target step has no KernelFunction with that signature.

Common situations: Using a sub-process as a step and referencing a function/parameter name that doesn't match any [KernelFunction] on the entry steps. Misspelling a function name in an edge definition. Referencing a function on a step that hasn't been registered as an entry point. Passing null for both functionName and parameterName when the entry steps have multiple functions or parameters (ambiguous inference fails).

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/fbe21300ca5e9274. Report an issue: GitHub.