{"record":{"id":"3afba882308b75b9","repo":"elsa-workflows/elsa-core","slug":"syntax-descriptor-with-expression-type-expressiontype-not","errorCode":null,"errorMessage":"Syntax descriptor with expression type {expressionType} not found in registry","messagePattern":"Syntax descriptor with expression type (.+?) not found in registry","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Workflows.Core/Serialization/Helpers/SyntheticPropertiesWriter.cs","lineNumber":51,"sourceCode":"\n            writer.WritePropertyName(propertyName);\n\n            var input = (Input?)inputValue;\n\n            if (input == null)\n            {\n                writer.WriteNullValue();\n                continue;\n            }\n\n            var expression = input.Expression;\n            var expressionType = expression?.Type;\n            var inputType = input.Type;\n            var memoryReferenceId = input.MemoryBlockReference().Id;\n            var expressionDescriptor = expressionType != null ? expressionDescriptorRegistry.Find(expressionType) : null;\n\n            if (expressionDescriptor == null)\n                throw new Exception($\"Syntax descriptor with expression type {expressionType} not found in registry\");\n\n            var inputModel = new\n            {\n                TypeName = inputType,\n                Expression = expression,\n                MemoryReference = new\n                {\n                    Id = memoryReferenceId\n                }\n            };\n\n            JsonSerializer.Serialize(writer, inputModel, inputModel.GetType(), options);\n        }\n    }\n\n    private void WriteSyntheticOutputProperties(Utf8JsonWriter writer, IActivity value, ActivityDescriptor activityDescriptor, JsonSerializerOptions options)\n    {\n        var syntheticOutputs = activityDescriptor.Outputs.Where(x => x.IsSynthetic).ToList();","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Workflows.Core/Serialization/Helpers/SyntheticPropertiesWriter.cs#L33-L69","documentation":"SyntheticPropertiesWriter.WriteSyntheticInputProperties throws when an activity input's expression type is not registered in the IExpressionDescriptorRegistry. To serialize synthetic input properties it must find the descriptor (syntax) for the expression, and none exists. This means the expression provider that defines that syntax was never registered in the host.","triggerScenarios":"An activity input (IInput with an Expression of type 'Foo') is serialized to a workflow definition model, but no expression descriptor named/typed 'Foo' was registered via AddSyntax<T> or the corresponding expression feature (e.g. JavaScript, CSharp, Liquid packages not installed).","commonSituations":"Serializing/saving a workflow that uses JavaScript expressions in a host without the Elsa JavaScript feature; a custom expression provider removed or conditionally registered; package version changes dropping a syntax provider from DI.","solutions":["Install/register the feature that provides the missing expression syntax (e.g. useJavaScript(), useCSharp(), useLiquid())","Register a custom descriptor with IExpressionDescriptorRegistry for the expression type before serializing","Remove or replace the input expression with a registered syntax in the workflow definition","Check DI configuration so expression descriptors are registered before serialization occurs"],"exampleFix":"// before\nservices.AddElsa(elsa => elsa.AddActivitiesFrom<Startup>()); // no syntax registered\n// after\nservices.AddElsa(elsa => elsa.AddActivitiesFrom<Startup>().UseJavaScript().UseLiquid());","handlingStrategy":"validation","validationCode":"var expressionType = activity.Inputs.Select(i => i.Expression?.Type).Where(t => t != null).Distinct();\nforeach (var t in expressionType)\n    if (expressionDescriptorRegistry.Find(t) == null)\n        throw new InvalidOperationException($\"Expression syntax '{t}' is not registered. Install the matching feature package.\");","typeGuard":null,"tryCatchPattern":"try { var json = await workflowSerializer.SerializeAsync(workflow); }\ncatch (Exception ex) when (ex.Message.StartsWith(\"Syntax descriptor\")) { logger.LogError(ex, \"Register the missing expression syntax feature before serializing\"); }","preventionTips":["Register all expression syntax features (JS, C#, Liquid, etc.) used by your workflows in DI","Never remove expression providers while stored workflows still use them","Add a startup check that every expression type in your activity library has a registered descriptor"],"tags":["serialization","expressions","workflow","registry"],"backgroundTag":"missing-dependency","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}