The name of the function, which is used to identify it in expressions and function calls. This should be unique across all defined functions in a workspace to avoid conflicts.
OptionalhintAn optional hint or description for the function, which can provide additional information about its purpose or usage. This is primarily for documentation and user guidance when working with the function in rules and expressions.
OptionalannotationsOptional annotations for the function, which can include any additional metadata or information that may be relevant for the function's behavior, usage, or categorization. Annotations can be used to provide extra context or instructions for how the function should be used or interpreted in rules and expressions.
OptionaldisabledIndicates whether the function is disabled. Disabled functions are not executable and cannot be called in rules or expressions. This allows users to define functions that are still being developed or debugged without causing execution failures in the workspace.
The expected parameters for the function, defined as an array of named parameters. Each parameter includes its expected type and whether it is optional. This is used for type checking and validation of function arguments when the function is called in rules and expressions. Functions that expect a parameter array (e.g., sum, avg, concat) can indicate this in their definition and will have their parameters validated accordingly. For functions that expect a parameter array, the parameters defined here represent the expected type of each element in the array. For example, a function that expects an array of numbers would have a single parameter with type 'number' and expectsParameterArray() returning true.
OptionallinesIf defined in a block, the lines of the function represent the sequence of executable actions that define the function's behavior. This allows for complex function definitions that involve multiple steps and operations, rather than just a single expression.
The return expression of the function, which defines how the return value is computed based on the input parameters. This can be the body of the function or the last line if defined in a block.
Definition of a custom function that can be used in rules and expressions.