microsoft/semantic-kernel · error · ArgumentException

Workflow inputs are not specified.

Error message

Workflow inputs are not specified.

What it means

Thrown by WorkflowBuilder.BuildProcessAsync when workflow.Inputs is null. Even if nodes are present, the builder requires an Inputs object to wire input events into the process, so a null Inputs is rejected after the nodes check.

Source

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

    /// <summary>
    /// Builds a process from a workflow definition.
    /// </summary>
    /// <param name="workflow">An instance of <see cref="Workflow"/>.</param>
    /// <param name="yaml">Workflow definition in YAML format.</param>
    /// <param name="stepTypes">Collection of preloaded step types.</param>
    public async Task<KernelProcess?> BuildProcessAsync(Workflow workflow, string yaml, Dictionary<string, Type>? stepTypes = null)
    {
        this._yaml = yaml;
        var stepBuilders = new Dictionary<string, ProcessStepBuilder>();

        if (workflow.Nodes is null || workflow.Nodes.Count == 0)
        {
            throw new ArgumentException("Workflow nodes are not specified.");
        }

        if (workflow.Inputs is null)
        {
            throw new ArgumentException("Workflow inputs are not specified.");
        }

        // TODO: Process outputs
        // TODO: Process variables

        ProcessBuilder processBuilder = new(workflow.Id, description: workflow.Description, stateType: typeof(ProcessDefaultState));

        if (workflow.Inputs.Events?.CloudEvents is not null)
        {
            foreach (CloudEvent inputEvent in workflow.Inputs.Events.CloudEvents)
            {
                await this.AddInputEventAsync(inputEvent, processBuilder).ConfigureAwait(false);
            }
        }

        if (workflow.Inputs.Messages is not null)
        {
            await this.AddInputMessagesEventAsync(processBuilder).ConfigureAwait(false);

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Include a non-null 'inputs' section in the workflow definition.
  2. Validate workflow.Inputs != null before calling BuildProcessAsync.
  3. If the workflow genuinely has no external inputs, supply an empty Inputs object rather than null.

Example fix

// before
workflow.Inputs = null;
await builder.BuildProcessAsync(workflow, yaml);

// after
workflow.Inputs ??= new Inputs();
await builder.BuildProcessAsync(workflow, yaml);
Defensive patterns

Strategy: validation

Validate before calling

if (workflow.Inputs is null)
    throw new ArgumentException("Workflow must declare an inputs section.");

Type guard

static bool HasInputs(Workflow w) => w.Inputs is not null;

Try / catch

try { await builder.BuildProcessAsync(workflow, yaml); }
catch (ArgumentException ex) when (ex.Message.Contains("inputs are not specified"))
{ /* supply an Inputs object, possibly empty */ }

Prevention

When it happens

Trigger: Calling BuildProcessAsync with a Workflow whose Inputs property is null (YAML omits the inputs section, or deserialization leaves it unset).

Common situations: Workflow definitions that declare nodes but forget the inputs block; partial test fixtures; schema mismatches during deserialization.

Related errors


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