Skip to main content
Create a Script function when multiple pages, reports, or jobs need the same tested domain operation. The runtime discovers public function classes from loaded assemblies.

Minimal scalar function

Select the appropriate base class for zero, one, two, or multiple arguments and for scalar versus vector-aware evaluation. Use an asynchronous base/interface when the operation performs I/O.

Design rules

  • Validate types and ranges at the boundary.
  • Keep FunctionName stable; changing it breaks scripts.
  • Declare aliases only for intentional compatibility.
  • Provide DefaultArgumentNames so generated help is meaningful.
  • Return Script IElement values or supported .NET objects consistently.
  • Honour cancellation and timeouts for I/O.
  • Avoid hidden global state.
  • Log externally visible side effects.
  • Never expose secrets through exceptions or object properties.

Inventory discovery

The runtime inventory finds the class when its assembly package loads. If the function does not appear:
  1. confirm the assembly is in the package manifest;
  2. check that its target framework matches the Neuron;
  3. inspect module/inventory startup events;
  4. verify the class is public and concrete;
  5. ensure all referenced assemblies are installed.

Test from C# and Script

Unit-test scalar conversion and invalid input directly. Then install the package in a test Neuron and evaluate:
Expected result:
Document the function in the package’s Mintlify section and include at least one copyable example and failure case.