{"record":{"id":"d37a21095b387315","repo":"microsoft/semantic-kernel","slug":"python-nodes-are-not-supported-in-the-dotnet-runti","errorCode":null,"errorMessage":"Python nodes are not supported in the dotnet runtime.","messagePattern":"Python nodes are not supported in the dotnet runtime\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs","lineNumber":178,"sourceCode":"\n            agentBuilder.OnComplete([.. node.OnError.Select(c => c.OnCondition!)]);\n        }\n\n        // ########################### Parsing node inputs ###########################\n\n        if (node.Inputs != null)\n        {\n            var inputMapping = this.ExtractNodeInputs(node.Id);\n            //agentBuilder.WithNodeInputs(node.Inputs); TODO: What to do here?\n        }\n\n        this._stepBuilders[node.Id] = stepBuilder;\n        return Task.CompletedTask;\n    }\n\n    private Task BuildPythonStepAsync(Node node, ProcessBuilder processBuilder)\n    {\n        throw new KernelException(\"Python nodes are not supported in the dotnet runtime.\");\n    }\n\n    private Task BuildDotNetStepAsync(Node node, ProcessBuilder processBuilder, Dictionary<string, Type>? stepTypes = null)\n    {\n        Verify.NotNull(node);\n\n        if (node.Agent is null || string.IsNullOrEmpty(node.Agent.Type))\n        {\n            throw new ArgumentException($\"The agent specified in the Node with id {node.Id} is not fully specified.\");\n        }\n\n        // For dotnet node type, the agent type specifies the assembly qualified namespace of the class to be executed.\n        Type? dotnetAgentType = null;\n        try\n        {\n            if (stepTypes is not null && stepTypes.TryGetValue(node.Agent.Type, out var type) && type is not null)\n            {\n                dotnetAgentType = type;","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs#L160-L196","documentation":"Thrown unconditionally by BuildPythonStepAsync. The .NET runtime of Semantic Kernel cannot execute Python-backed workflow nodes, so any node with Type 'python' is rejected outright.","triggerScenarios":"Calling BuildProcessAsync on a workflow that contains at least one node with node.Type == \"python\"; the dispatcher routes to BuildPythonStepAsync which always throws.","commonSituations":"Sharing a cross-language workflow definition (authored for the Python runtime) with the .NET runtime; mixed-language pipelines where some nodes are Python.","solutions":["Run Python nodes on the Python Semantic Kernel runtime instead of the .NET one.","Replace the Python node with an equivalent 'dotnet' or 'declarative' node executable in the .NET runtime.","Filter or split the workflow so the .NET runtime only sees dotnet/declarative nodes."],"exampleFix":"// before: workflow authored for python runtime, run under dotnet\nnode.Type = \"python\";\n\n// after: use a dotnet node\nnode.Type = \"dotnet\";\nnode.Agent = new AgentDefinition { Type = typeof(MyDotNetStep).AssemblyQualifiedName };","handlingStrategy":"validation","validationCode":"if (workflow.Nodes.Any(n => n.Type == \"python\"))\n    throw new KernelException(\"Python nodes require the Python runtime; filter them before using the dotnet runtime.\");","typeGuard":"static bool HasPythonNodes(Workflow w) => w.Nodes?.Any(n => n.Type == \"python\") == true;","tryCatchPattern":"try { await builder.BuildProcessAsync(workflow, yaml); }\ncatch (KernelException ex) when (ex.Message.Contains(\"Python nodes are not supported\"))\n{ /* switch to python runtime or replace the node */ }","preventionTips":["Keep .NET and Python workflow definitions separate.","Detect python nodes up front and route the workflow to the correct runtime.","Document the runtime capability matrix for workflow authors."],"tags":["semantic-kernel","process","workflow","python","runtime"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}