microsoft/semantic-kernel · error · KernelException

Unsupported target type

Error message

Unsupported target type

What it means

Thrown by ThenAction.FromKernelProcessEdge when converting a KernelProcessEdge to a declarative workflow ThenAction and the edge's OutputTarget is not one of the four recognized types: KernelProcessStateTarget, KernelProcessFunctionTarget, KernelProcessEmitTarget, or KernelProcessAgentInvokeTarget. The serializer encounters an unknown or newly-introduced target type and cannot map it.

Source

Thrown at dotnet/src/Experimental/Process.Abstractions/Serialization/Model/Workflow.cs:1098

            {
                Type = ActionType.Emit,
                EmitMessageType = emitTarget.EventName,
                EmitMessagePayload = emitTarget.Payload,
            };
        }
        if (edge.OutputTarget is KernelProcessAgentInvokeTarget agentInvokeTarget)
        {
            return new ThenAction()
            {
                Type = ActionType.NodeInvocation,
                Node = agentInvokeTarget.StepId == ProcessConstants.EndStepName ? "End" : agentInvokeTarget.StepId,
                Inputs = agentInvokeTarget.InputEvals,
                MessagesIn = agentInvokeTarget.MessagesInEval,
                Thread = agentInvokeTarget.ThreadEval
            };
        }

        throw new KernelException("Unsupported target type");
    }
}

/// <summary>
/// Defines the types of actions that can be performed in workflow orchestration.
/// Action types determine what kind of operation should be executed when conditions are met.
/// </summary>
public enum ActionType
{
    /// <summary>
    /// An action that invokes a specific workflow node to execute its logic.
    /// Node invocation actions transfer control to another part of the workflow.
    /// </summary>
    NodeInvocation,

    /// <summary>
    /// An action that updates the value of a workflow variable or state.
    /// Update actions allow workflows to modify their internal state during execution.

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Inspect the edge.OutputTarget runtime type in a debugger to identify which target type is unsupported, then avoid serializing that edge or upgrade the Workflow model to handle it.
  2. Ensure you are using a compatible version of the Process.Experimental package where the Workflow.FromKernelProcessEdge factory recognizes all target types your process uses.
  3. If using a custom target type, convert the edge to a supported target (e.g., KernelProcessFunctionTarget) before serialization.
  4. Report or contribute support for the missing target type in the Workflow model if it is a built-in SK type.
Defensive patterns

Strategy: validation

Validate before calling

// Before serializing, verify all edges have recognized target types.
private static readonly HashSet<Type> _supportedTargets = new()
{
    typeof(KernelProcessStateTarget),
    typeof(KernelProcessFunctionTarget),
    typeof(KernelProcessEmitTarget),
    typeof(KernelProcessAgentInvokeTarget)
};

public bool ValidateEdgeTargets(KernelProcess process)
{
    foreach (var edgeEntry in process.Edges)
    {
        foreach (var edge in edgeEntry.Value)
        {
            if (!_supportedTargets.Contains(edge.OutputTarget.GetType()))
            {
                return false;
            }
        }
    }
    return true;
}

Prevention

When it happens

Trigger: Serializing a KernelProcess (via WorkflowBuilder/WorkflowSerializer) that contains an edge whose OutputTarget is a custom or unsupported ProcessStepTargetBuilder subclass. Also triggered by version mismatches where a newer runtime creates target types the workflow serialization layer does not yet understand.

Common situations: Upgrading the Semantic Kernel Process package to a version that introduces a new target type but the serialization/Workflow model hasn't been updated. Creating a custom ProcessStepTargetBuilder subclass that is not one of the four known targets. Exporting a process to YAML/declarative format when it contains map or agent-proxy edges that fall through all type checks.

Related errors


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