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
- 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.
- Ensure you are using a compatible version of the Process.Experimental package where the Workflow.FromKernelProcessEdge factory recognizes all target types your process uses.
- If using a custom target type, convert the edge to a supported target (e.g., KernelProcessFunctionTarget) before serialization.
- 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
- Ensure process version and serialization model are in sync (same NuGet package version).
- Avoid custom ProcessStepTargetBuilder subclasses for processes you intend to serialize.
- Test serialization of all edge types before deploying a process export workflow.
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
- The process must have an Id set
- Failed to deserialize schema.
- Attempt to build a workflow node from step with no Id
- The edge target is not a function target: {e.OutputTarget}
- Failed to parse schema.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/ff53111540eb5c8e.
Report an issue: GitHub.