{"record":{"id":"64098444faea1dc3","repo":"elsa-workflows/elsa-core","slug":"property-arg-name-not-found-on-activity-type-activitytype","errorCode":null,"errorMessage":"Property '{arg.Name}' not found on activity type '{activityType.Name}'","messagePattern":"Property '(.+?)' not found on activity type '(.+?)'","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Dsl.ElsaScript/Compiler/ElsaScriptCompiler.cs","lineNumber":223,"sourceCode":"            // No positional arguments, use default constructor\n            var activityConstructorContext = new ActivityConstructorContext(activityDescriptor, (t) => new(ActivityActivator.Create(t)));\n            var activityConstructionResult = activityDescriptor.Constructor(activityConstructorContext);\n            activity = activityConstructionResult.Activity;\n        }\n\n        // Set named argument properties\n        foreach (var arg in namedArgs)\n        {\n            var property = activityType.GetProperty(arg.Name!);\n\n            if (property != null)\n            {\n                var value = CompileExpression(arg.Value, property.PropertyType);\n                property.SetValue(activity, value);\n            }\n            else\n            {\n                throw new InvalidOperationException($\"Property '{arg.Name}' not found on activity type '{activityType.Name}'\");\n            }\n        }\n\n        return activity;\n    }\n\n    private async Task<IActivity> CompileBlockAsync(BlockNode block, CancellationToken cancellationToken = default)\n    {\n        var activities = new List<IActivity>();\n\n        foreach (var statement in block.Statements)\n        {\n            var activity = await CompileStatementAsync(statement, cancellationToken);\n            if (activity != null)\n            {\n                activities.Add(activity);\n            }\n        }","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Dsl.ElsaScript/Compiler/ElsaScriptCompiler.cs#L205-L241","documentation":"While compiling an activity invocation, named arguments are mapped onto CLR properties of the activity type via reflection; if a named argument has no matching property on the activity type, the compiler throws InvalidOperationException naming the argument and activity type. The script passed a property the activity does not declare.","triggerScenarios":"Invoking an activity with a named argument (arg.Name) that does not correspond to any public settable property on the resolved activityDescriptor.ClrType.","commonSituations":"Typo in a named argument (e.g. 'url' vs 'Url'), argument names from an older activity version that was renamed, or passing non-input fields that are not exposed as properties.","solutions":["Fix the argument name to match the activity's property (Elsa inputs are C# properties, matching by exact name).","Check the activity's input definitions/descriptor for the correct property names.","Upgrade the activity package if the script targets an older property name; or update the script after a rename.","Catch InvalidOperationException during compilation and highlight the offending argument in the editor."],"exampleFix":"// before\nhttpGet(url: \"https://example.com\")   // property is 'Url'\n// after\nhttpGet(Url: \"https://example.com\")","handlingStrategy":"validation","validationCode":"const descriptor = await registry.find(d => d.name === invocation.name); const bad = invocation.args.filter(a => a.name && !descriptor.inputs?.some(p => p.name === a.name)); if (bad.length) throw new Error('Unknown properties: ' + bad.map(b => b.name).join(', '));","typeGuard":"function argsMatchDescriptor(args, descriptor) { return args.every(a => !a.name || descriptor.inputs.some(p => p.name === a.name)); }","tryCatchPattern":"try { await compileScript(script); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"not found on activity type\")) { highlightBadArgument(ex); }","preventionTips":["Generate argument autocompletion from the activity descriptor's input list.","Re-validate scripts after upgrading activity packages (property renames).","Match argument names exactly to the activity's C# input properties."],"tags":["dsl","reflection","property-not-found"],"backgroundTag":"missing-required-argument","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}