The functions section of a function library manifest defines the functions the library exposes. It's a map where each key is a function name and each value describes that function's parameters, return type, and execution characteristics.
The following example declares a function that capitalizes text:
A function has the following fields:
| Field | Required | Description |
|---|---|---|
parameters | No | Array of parameter definitions. Maximum 10. Defaults to no parameters. |
returns | No | Return type definition. Defaults to void. |
async | No | Whether the function returns a Promise. Defaults to false. |
displayName | No | Name of the function shown in the editor. |
description | No | Function description. |
Each entry in parameters describes one argument the function accepts:
| Field | Required | Description |
|---|---|---|
dataType | Yes | The type of value the parameter accepts. |
displayName | No | Name of the parameter shown in the editor. |
description | No | Parameter description. |
optional | No | Whether the parameter is optional. Only trailing parameters can be optional because JavaScript arguments are positional. Defaults to false. |
defaultValue | No | Default the editor shows as a hint. Not passed at runtime, so your implementation must handle the missing value. Used only when optional is true. |
arrayItems | When dataType is arrayItems | Defines what elements in the array look like. |
data | When dataType is data | Defines the fields inside the nested object. |
function | When dataType is function | Defines the parameters and return type of a callback parameter. |
textEnum | When dataType is textEnum | List of allowed string options. |
link | When dataType is link | Configuration for the link parameter, such as supported link types. |
Set optional to true to make a parameter optional. Only trailing parameters can be optional because JavaScript arguments are positional. Use defaultValue to give the editor a hint to display for the missing value.
The following example declares roundNumber with an optional parameter and a default value:
For array parameters, set dataType to 'arrayItems'. Then define the array elements under arrayItems.item.
For complex object parameters, set dataType to 'data'. Then define each field of the object under data.items.
For a fixed set of string options, set dataType to 'textEnum' and list the choices under textEnum.options.
A parameter can itself be a function. Set its dataType to 'function', then describe the callback's parameters and return type under function.
For a parameter that accepts a navigation link, set dataType to 'link'. The optional link field restricts which kinds of links are allowed. For the available fields, see Link.
The returns field describes a function's return value:
| Field | Required | Description |
|---|---|---|
dataType | Yes | The type of value this function returns. |
displayName | No | Name of the return value shown in the editor. |
description | No | Description of the return value. |
arrayItems | When dataType is arrayItems | Defines what elements in the returned array look like. |
data | When dataType is data | Defines the fields inside the returned nested object. |
function | When dataType is function | Defines the parameters and return type of the returned callback. |
textEnum | When dataType is textEnum | List of allowed string options. |
link | When dataType is link | Configuration for the returned link, such as supported link types. |
If a function doesn't return a value, omit returns.
Set async to true for a function whose implementation returns a Promise. The returns field describes the resolved value's type, not the Promise.
Last updated: 2 November 2026