microsoft/semantic-kernel · error · ArgumentException

Unsupported node type: {node.Type}

Error message

Unsupported node type: {node.Type}

What it means

Thrown by WorkflowBuilder when dispatching a Node whose Type is not one of the recognized kinds. The builder handles 'dotnet', 'python', and 'declarative'; any other node.Type falls through to this ArgumentException.

Source

Thrown at dotnet/src/Experimental/Process.Core/Workflow/WorkflowBuilder.cs:119

    internal async Task AddStepAsync(Node node, ProcessBuilder processBuilder, Dictionary<string, Type>? stepTypes = null)
    {
        Verify.NotNull(node);

        if (node.Type == "dotnet")
        {
            await this.BuildDotNetStepAsync(node, processBuilder, stepTypes).ConfigureAwait(false);
        }
        else if (node.Type == "python")
        {
            await this.BuildPythonStepAsync(node, processBuilder).ConfigureAwait(false);
        }
        else if (node.Type == "declarative")
        {
            await this.BuildDeclarativeStepAsync(node, processBuilder).ConfigureAwait(false);
        }
        else
        {
            throw new ArgumentException($"Unsupported node type: {node.Type}");
        }
    }

    private Task BuildDeclarativeStepAsync(Node node, ProcessBuilder processBuilder)
    {
        Verify.NotNull(node);

        // Check for built-in step types
        if (node.Id.Equals("End", StringComparison.OrdinalIgnoreCase))
        {
            var endBuilder = processBuilder.AddEndStep();
            this._stepBuilders["End"] = endBuilder;
            return Task.CompletedTask;
        }

        AgentDefinition? agentDefinition = node.Agent ?? throw new KernelException("Declarative steps must have an agent defined.");
        var stepBuilder = processBuilder.AddStepFromAgent(agentDefinition, node.Id);
        if (stepBuilder is not ProcessAgentBuilder agentBuilder)

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Set node.Type to one of 'dotnet', 'python', or 'declarative' (lowercase) as supported by the runtime.
  2. Upgrade the Semantic Kernel runtime to a version that supports the node type if it is a newer feature.
  3. Validate node.Type against the allowed set before calling BuildProcessAsync.

Example fix

// before: unsupported type
node.Type = "DotNet";

// after
node.Type = "dotnet";
Defensive patterns

Strategy: validation

Validate before calling

var allowed = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "dotnet", "python", "declarative" };
foreach (var n in workflow.Nodes)
    if (!allowed.Contains(n.Type)) throw new ArgumentException($"Unsupported node type: {n.Type}");

Type guard

static bool IsSupportedNodeType(string? t) => t is "dotnet" or "python" or "declarative";

Try / catch

try { await builder.BuildProcessAsync(workflow, yaml); }
catch (ArgumentException ex) when (ex.Message.Contains("Unsupported node type"))
{ /* correct node.Type or upgrade runtime */ }

Prevention

When it happens

Trigger: A workflow node with node.Type set to a value other than 'dotnet', 'python', or 'declarative' (typos, unknown types, case mismatch, or a forward-compatible field the runtime does not yet support).

Common situations: Workflow YAML using a new node type not supported by the installed runtime version; typos like 'DotNet' or 'declare'; cross-language definitions authored for a newer schema.

Related errors


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