elsa-workflows/elsa-core · error · BpmnBindingException

An < : > element of the ' ' binding declares no ' '.

Error message

An <{NamespacePrefix}:{InputElementName}> element of the '{activityType}' binding declares no '{InputNameAttributeName}'.

What it means

Within BpmnActivityBindingFormat.Read, each child <elsa:input> element of an activity binding must carry the input-name attribute identifying which activity input it sets. When an input element omits it, the parser cannot map the value to an activity property and throws BpmnBindingException. Duplicate input names are rejected separately.

Solutions

  1. Add the input-name attribute (named by InputNameAttributeName) to each input element, matching an input the declared activity type actually defines.
  2. Validate inputs against the activity type's declared input descriptors before import.
  3. Fix the element's namespace/prefix so the attribute resolves correctly.
  4. Remove input elements that carry no name rather than leaving empty shells.

Example fix

// before
<elsa:activity-binding activity-type="Elsa.Http:WriteHttpResponse">
  <elsa:input value="Hello" />
</elsa:activity-binding>

// after
<elsa:activity-binding activity-type="Elsa.Http:WriteHttpResponse">
  <elsa:input input-name="Content" value="Hello" />
</elsa:activity-binding>
Defensive patterns

Strategy: validation

Validate before calling

foreach (var input in bindingElement.Elements().Where(e => e.Name.LocalName == "input"))
    if (input.Attributes().All(a => a.Name.LocalName != "input-name"))
        throw new InvalidOperationException($"<input> at line {((IXmlLineInfo)input).LineNumber} is missing 'input-name'.");

Try / catch

try
{
    var activity = bindingFormat.Read(element);
}
catch (BpmnBindingException ex)
{
    logger.LogError(ex, "Invalid BPMN input element in binding for activity type {ActivityType}", declaredType);
}

Prevention

When it happens

Trigger: Parsing a BPMN document where an <elsa:input> (InputElementName) child of the binding has no input-name attribute — AttributeOf(input, InputNameAttributeName) returns null inside the Children loop.

Common situations: Hand-edited BPMN where the name attribute was deleted or misspelled; tool exports emitting value-only input elements; XML namespace mishandling so the attribute name doesn't match InputNameAttributeName.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of elsa-workflows/elsa-core@fe9217bdfa (2026-09-13). Data as JSON: /api/errors/d644810c23ddb4a5. Report an issue: GitHub.

Appendix: source

Thrown at src/modules/Elsa.Bpmn.Interchange/Binding/BpmnActivityBindingFormat.cs:207

    {
        var activityType = AttributeOf(element, ActivityTypeAttributeName)
                           ?? throw new BpmnBindingException($"An <{NamespacePrefix}:{BindingElementName}> element declares no '{ActivityTypeAttributeName}', so there is nothing to build.");

        var activityJson = new JsonObject
        {
            ["type"] = activityType
        };

        // Every name seen so far, in the order the document declares them, so a second <elsa:input> with the same
        // name is refused rather than silently overwriting activityJson[name] and leaving the earlier one's
        // configuration invisible.
        var seenInputNames = new List<string>();
        var seenInputNameSet = new HashSet<string>(StringComparer.Ordinal);

        foreach (var input in element.Children.Where(child => child.Name == InputQName))
        {
            var name = AttributeOf(input, InputNameAttributeName)
                       ?? throw new BpmnBindingException($"An <{NamespacePrefix}:{InputElementName}> element of the '{activityType}' binding declares no '{InputNameAttributeName}'.");

            if (!seenInputNameSet.Add(name))
                throw new BpmnBindingException($"The '{activityType}' binding declares the input '{name}' more than once. Each <{NamespacePrefix}:{InputElementName}> must name a distinct input.");

            seenInputNames.Add(name);
            activityJson[name] = Parse(input.Value, name, activityType);
        }

        IActivity activity;

        try
        {
            activity = activitySerializer.Deserialize(activityJson.ToJsonString());
        }
        catch (Exception exception) when (exception is JsonException or NotSupportedException)
        {
            throw new BpmnBindingException($"The binding to activity type '{activityType}' could not be deserialized: {exception.Message}");
        }

View on GitHub (pinned to fe9217bdfa)