elsa-workflows/elsa-core · error · BpmnBindingException

The BPMN work binding kind

Error message

The BPMN work binding kind '{binding.GetType().Name}' declared by element '{binding.ElementId}' is not supported by this binder.

What it means

The BPMN work binding hierarchy contains a kind this binder does not know how to convert into an Elsa activity. Since the binding hierarchy is closed within a library version, this only occurs when the interchange library version that produced the bindings is newer than the binder handling them.

Solutions

  1. Align all Elsa.Bpmn.Interchange-related packages to the same version (update the binder's package to the version that produced the document).
  2. Re-export the .bpmn with the older/installed library version so bindings use supported kinds.
  3. If neither works, report the missing binding kind so the binder can gain a case for it.

Example fix

// before
dotnet add package Elsa.Bpmn.Interchange --version 3.5.0  // binder, while bindings were produced by 3.6.0
// after
dotnet add package Elsa.Bpmn.Interchange --version 3.6.0  // versions aligned
Defensive patterns

Strategy: fallback

Try / catch

try { await importer.ImportAsync(bpmn); }
catch (BpmnBindingException ex) when (ex.Message.Contains("is not supported by this binder"))
{
    logger.LogError(ex, "Binding kind not supported; align Elsa.Bpmn.Interchange package versions.");
}

Prevention

When it happens

Trigger: BpmnWorkBinder.CreateActivity's switch over BpmnWorkBinding falls through to the default arm because the binding object's runtime type matches no known kind (e.g. a new BpmnWorkBinding subtype added in a newer package version).

Common situations: Mixed package versions of the Elsa.Bpmn.Interchange library (one package updated, another not) after an upgrade; a custom library build adding a binding kind.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at src/modules/Elsa.Bpmn.Interchange/Binding/BpmnWorkBinder.cs:135

        binding switch
        {
            BpmnWorkBinding.TimerWait timer => new Delay(IsoDurationOf(timer)),
            BpmnWorkBinding.MessageWait message => new Event(message.MessageName),
            BpmnWorkBinding.SignalWait signal => new Event(signal.SignalName),
            BpmnWorkBinding.MessagePublish publish => new PublishEvent
            {
                EventName = new(publish.MessageName)
            },
            BpmnWorkBinding.CallProcess call => new DispatchWorkflow
            {
                WorkflowDefinitionId = new(CalledElementOf(call)),
                WaitForCompletion = new(call.WaitForCompletion)
            },
            BpmnWorkBinding.NestedProcess nested => BindScope(nested.Definition, bindings),
            BpmnWorkBinding.UnboundTask unbound => ReadDeclaredActivity(definition, unbound, consumed),
            // The binding hierarchy is closed, so this is reachable only from a library version that added a kind this
            // binder has never heard of. Skipping it would produce a scope whose interpreter starts work nothing maps.
            _ => throw new BpmnBindingException($"The BPMN work binding kind '{binding.GetType().Name}' declared by element '{binding.ElementId}' is not supported by this binder.")
        };

    private IActivity ReadDeclaredActivity(BpmnProcessDefinition definition, BpmnWorkBinding.UnboundTask unbound, ISet<string> consumed)
    {
        var element = definition.Elements.FirstOrDefault(element => string.Equals(element.ElementId, unbound.ElementId, StringComparison.Ordinal));

        if (BpmnActivityBindingFormat.Find(element?.Extensions) is not { } declaration)
        {
            throw new BpmnBindingException(
                $"BPMN element '{unbound.ElementId}' of process '{unbound.ProcessId}' is a '{unbound.TaskType}': the document says what it is for, not how to perform it, and nothing binds it to an Elsa activity. "
                + $"Declare one with an <{BpmnActivityBindingFormat.NamespacePrefix}:{BpmnActivityBindingFormat.BindingElementName}> element inside the element's <extensionElements>.");
        }

        consumed.Add(unbound.ElementId);

        return format.Read(declaration);
    }

View on GitHub (pinned to fe9217bdfa)