{"record":{"id":"ff53111540eb5c8e","repo":"microsoft/semantic-kernel","slug":"unsupported-target-type","errorCode":null,"errorMessage":"Unsupported target type","messagePattern":"Unsupported target type","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Abstractions/Serialization/Model/Workflow.cs","lineNumber":1098,"sourceCode":"            {\n                Type = ActionType.Emit,\n                EmitMessageType = emitTarget.EventName,\n                EmitMessagePayload = emitTarget.Payload,\n            };\n        }\n        if (edge.OutputTarget is KernelProcessAgentInvokeTarget agentInvokeTarget)\n        {\n            return new ThenAction()\n            {\n                Type = ActionType.NodeInvocation,\n                Node = agentInvokeTarget.StepId == ProcessConstants.EndStepName ? \"End\" : agentInvokeTarget.StepId,\n                Inputs = agentInvokeTarget.InputEvals,\n                MessagesIn = agentInvokeTarget.MessagesInEval,\n                Thread = agentInvokeTarget.ThreadEval\n            };\n        }\n\n        throw new KernelException(\"Unsupported target type\");\n    }\n}\n\n/// <summary>\n/// Defines the types of actions that can be performed in workflow orchestration.\n/// Action types determine what kind of operation should be executed when conditions are met.\n/// </summary>\npublic enum ActionType\n{\n    /// <summary>\n    /// An action that invokes a specific workflow node to execute its logic.\n    /// Node invocation actions transfer control to another part of the workflow.\n    /// </summary>\n    NodeInvocation,\n\n    /// <summary>\n    /// An action that updates the value of a workflow variable or state.\n    /// Update actions allow workflows to modify their internal state during execution.","sourceCodeStart":1080,"sourceCodeEnd":1116,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Abstractions/Serialization/Model/Workflow.cs#L1080-L1116","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before serializing, verify all edges have recognized target types.\nprivate static readonly HashSet<Type> _supportedTargets = new()\n{\n    typeof(KernelProcessStateTarget),\n    typeof(KernelProcessFunctionTarget),\n    typeof(KernelProcessEmitTarget),\n    typeof(KernelProcessAgentInvokeTarget)\n};\n\npublic bool ValidateEdgeTargets(KernelProcess process)\n{\n    foreach (var edgeEntry in process.Edges)\n    {\n        foreach (var edge in edgeEntry.Value)\n        {\n            if (!_supportedTargets.Contains(edge.OutputTarget.GetType()))\n            {\n                return false;\n            }\n        }\n    }\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["semantic-kernel","process-framework","serialization","workflow","version-mismatch"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}