{"record":{"id":"4b951d093d00ee21","repo":"elsa-workflows/elsa-core","slug":"the-bpmn-host-command-command-gettype-name-is-not-supported","errorCode":null,"errorMessage":"The BPMN host command '{command.GetType().Name}' is not supported by this host.","messagePattern":"The BPMN host command '(.+?)' is not supported by this host\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Bpmn/Hosting/BpmnCommandApplier.cs","lineNumber":67,"sourceCode":"\n        foreach (var command in commands)\n        {\n            switch (command)\n            {\n                case BpmnHostCommand.StartWork start:\n                    await StartWorkAsync(start);\n                    break;\n                case BpmnHostCommand.CancelWorkSubtree cancel:\n                    await CancelWorkSubtreeAsync(cancel);\n                    break;\n                case BpmnHostCommand.SignalEnclosingScope signal:\n                    await SignalEnclosingScopeAsync(signal);\n                    break;\n                default:\n                    // The command hierarchy is closed, so this can only be reached by a library version that added a\n                    // command this host has never heard of. Refusing is the only honest answer: silently skipping it\n                    // would run a different process than the one the interpreter decided on.\n                    throw new NotSupportedException($\"The BPMN host command '{command.GetType().Name}' is not supported by this host.\");\n            }\n\n            memory.SaveWork();\n        }\n    }\n\n    private async ValueTask StartWorkAsync(BpmnHostCommand.StartWork start)\n    {\n        var activity = process.FindWorkActivity(start.BindingRef)\n                       ?? throw new InvalidOperationException(\n                           $\"BPMN element '{start.ElementId}' binds work '{start.BindingRef}', which activity '{process.Id}' does not map to a child activity.\");\n\n        // The rule that a nested scope registers no start triggers is enforced by ApplyAsync's pre-scan, before any\n        // command in the batch is applied — not here, where earlier commands in the same batch could already have\n        // been applied and persisted.\n        var workflowExecutionContext = scopeContext.WorkflowExecutionContext;\n\n        // The child's context is created up front so that this scope has its id before the child ever runs, and can","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Bpmn/Hosting/BpmnCommandApplier.cs#L49-L85","documentation":"BpmnCommandApplier.ApplyAsync handles a closed set of BPMN host command types; any command outside that set hits the default branch and throws NotSupportedException. The code comments that this can only be reached by a library version that added a new command type the host does not know about, and refusing is preferable to silently skipping the command.","triggerScenarios":"Applying a BpmnHostCommand batch where a command instance is of a type added in a newer interpreter/library version than this host supports (mixed assembly versions in the same process).","commonSituations":"Mismatched package versions after a partial upgrade of Elsa.Bpmn packages; a plugin issuing custom commands the host does not recognize.","solutions":["Upgrade the host (BpmnCommandApplier / Elsa.Bpmn host package) to the same version as the component producing the commands.","Align all Elsa.Bpmn.* package versions to a single release in your dependency graph.","If you added a custom command, extend ApplyAsync's switch to handle it explicitly."],"exampleFix":"// before\n<PackageReference Include=\"Elsa.Bpmn.Host\" Version=\"3.0.0\" />\n// after\n<PackageReference Include=\"Elsa.Bpmn.Host\" Version=\"3.1.0\" /> <!-- match interpreter version -->","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await applier.ApplyAsync(context, commands); }\ncatch (NotSupportedException ex) { log.LogCritical(ex, \"Host/interpreter version mismatch on command {Command}\", ex.Message); throw; }","preventionTips":["Align all Elsa.Bpmn.* package versions in Directory.Packages.props.","After upgrades, run the BPMN integration tests before deploying.","Never inject custom host commands without extending the applier."],"tags":["bpmn","version-mismatch","unsupported-command"],"backgroundTag":"unsupported-operation","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}