{"record":{"id":"e35c30d17d9053e1","repo":"elsa-workflows/elsa-core","slug":"output-converter-converterid-failed-during-stage-for-output","errorCode":null,"errorMessage":"Output converter '{converterId}' failed during {stage} for output '{outputName}' of activity '{activityId}'.","messagePattern":"Output converter '(.+?)' failed during (.+?) for output '(.+?)' of activity '(.+?)'\\.","errorType":"exception","errorClass":"OutputConversionException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Workflows.Core/Services/OutputConverterInvoker.cs","lineNumber":25,"sourceCode":"/// <inheritdoc />\npublic class OutputConverterInvoker(\n    IOutputConverterRegistry registry,\n    IOutputConverterSettingsValidator settingsValidator) : IOutputConverterInvoker\n{\n    /// <inheritdoc />\n    public object? Invoke(\n        ActivityExecutionContext activityExecutionContext,\n        Output output,\n        string outputName,\n        Type sourceType,\n        object value,\n        OutputBindingDestination destination)\n    {\n        var configuration = output.Converter ?? throw new InvalidOperationException(\"The output binding has no converter configuration.\");\n        var descriptor = registry.Find(configuration.Id);\n\n        if (descriptor == null)\n            throw CreateException(OutputConversionFailureStage.Resolution);\n\n        if (!IsRuntimeValueCompatible(value, sourceType) || !descriptor.SourceType.IsAssignableFrom(sourceType))\n            throw CreateException(OutputConversionFailureStage.SourceCompatibility);\n\n        if (!OutputConverterRegistry.IsAssignableToDestination(descriptor.ResultType, destination.Type))\n            throw CreateException(OutputConversionFailureStage.ResultValidation);\n\n        IOutputConverter converter;\n\n        try\n        {\n            converter = activityExecutionContext.WorkflowExecutionContext.ServiceProvider\n                .GetRequiredKeyedService<IOutputConverter>(configuration.Id);\n        }\n        catch (Exception e)\n        {\n            throw CreateException(OutputConversionFailureStage.Resolution, e);\n        }","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Workflows.Core/Services/OutputConverterInvoker.cs#L7-L43","documentation":"OutputConverterInvoker.Invoke throws an OutputConversionException with this message template when the configured converter id cannot be resolved from the IOutputConverterRegistry (stage = Resolution). Every converter failure in the pipeline is normalized into this single message; the exception's stage property tells you which step failed.","triggerScenarios":"An output binding's Converter configuration references a converter id (configuration.Id) that is not registered in IOutputConverterRegistry when Invoke runs, so registry.Find returns null.","commonSituations":"Typo in the converter id in the activity/output binding configuration; the converter feature/module registering the converter was not added to the host; converter registered under a different key or DI key mismatch.","solutions":["Correct the converter id in the output binding configuration to match a registered converter.","Register the output converter feature/module (or the converter itself with the registry) at host startup.","List registered converters at startup (inspect IOutputConverterRegistry) and verify the configured id exists.","Catch OutputConversionException and inspect its Stage/ConverterId properties to pinpoint which converter configuration is wrong."],"exampleFix":"// before\noutput.Converter = new OutputConverterConfiguration { Id = \"json-converter\" };\n// after\noutput.Converter = new OutputConverterConfiguration { Id = \"my-registered-converter-id\" }; // id present in IOutputConverterRegistry","handlingStrategy":"type-guard","validationCode":"var registry = serviceProvider.GetRequiredService<IOutputConverterRegistry>();\nif (output.Converter != null && registry.Find(output.Converter.Id) == null)\n    throw new InvalidOperationException($\"Converter '{output.Converter.Id}' is not registered.\");","typeGuard":"bool IsConverterRegistered(IOutputConverterRegistry registry, string? id) => id != null && registry.Find(id) != null;","tryCatchPattern":"try { var value = invoker.Invoke(ctx, output, outputName, sourceType, raw, destination); }\ncatch (OutputConversionException e) when (e.Stage == OutputConversionFailureStage.Resolution)\n{ logger.LogError(e, \"Converter {Id} not found for output {Output}\", output.Converter?.Id, outputName); }","preventionTips":["Keep converter ids in constants shared between registration and configuration.","Register all converter modules in host startup before workflows run.","Validate workflow definitions (including converter ids) at publish time."],"tags":["output-converter","resolution","not-registered","workflow-core"],"backgroundTag":"resource-not-found","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"}