> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Enumerations in applications

> How to define and use enumerations (enums) in the pronghorn.json file for Itential Platform applications.

This guide explains the enum feature and how to use it in the `pronghorn.json` file for Itential Platform applications.

## Terminology and concepts

Enum is short for "enumerations," meaning "specifically listed." An enum specifies a list of constant values assigned to a type. A constant is an identifier (name) for a value that cannot change during the execution of a script or command.

Essentially, an enum is a special "class" representing a group of constants. Once an enum is defined in configuration, you can constrain input to the set of values in that enumeration.

## Define workflow tasks using enums

Enums represent a fixed number of possible values. Use an enum when there is a definite number of fixed values for a variable — similar to Boolean values of `true` or `false`.

To create an enum input for a task:

* Use the `enum` keyword as the type.
* Use enum for values that are not going to change, such as months, days of the week, colors, or shirt sizes.

Create an `enumerals` array containing all valid values. In the example below, the `enumerals` array contains the days of the week.

### Example

The `WhatDay` task:

```json
"methods": [
  {
    "name": "WhatDay",
    "description": "Day of the week picker.",
    "summary": "Day of the week picker.",
    "deprecated": false,
    "roles": [
      "admin"
    ],
    "input": [
      {
        "name": "theDay",
        "type": "enum",
        "enumerals": ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"],
        "description": "Pick a day of the week."
      }
    ],
    "output": {
      "name": "hoursDaylight",
      "description": "The numerical value of how many hours of daylight the selected day has.",
      "type": "string"
    },
    "task": true
  }
]
```

You can create enumeration values that appear as a selection when filling a user input field. You can also lock enum values to ensure that only the values you have defined are accepted.

## Use enumerations in Workflow Builder

Once a task is created:

#### Open Workflow Builder

Navigate to Workflow Builder.

#### Add the task to the canvas

Add the task to the canvas — for example, the `WhatDay` task.

![](/_fern-img/1f856a8cebd34cca7531e946305b5e08233c7c6fb8c75d2ccbff70c6e816362f.webp)

#### Configure the task

Double-click the task to configure it. Change the field type from `job` to `static`. A pre-populated dropdown list containing the days of the week will appear.

![](/_fern-img/17edb6ef84880405c0536edb38b1f86ec1c0b7b92434cddff7fdc33a47f46600.webp)

## Itential application schema

The following JSON schema can be used as a reference for building valid `pronghorn.json` files, specifically the `enum` property:

```json
{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique name of Pronghorn module. Most likely matches name in package.json.",
      "pattern": "^(@[a-zA-Z0-9][-._a-zA-Z0-9]*/)?[a-zA-Z0-9][-._a-zA-Z0-9]*$"
    },
    "title": {
      "type": "string",
      "description": "Application's web API (REST or JSON RPC) namespace.",
      "pattern": "^[a-zA-Z0-9][-_a-zA-Z0-9]*$"
    },
    "displayName": {
      "type": "string",
      "description": "Name displayed for application in Workflow Builder's application drop-down."
    },
    "export": {
      "type": "string",
      "description": "Application's JavaScript namespace. Must match value of module.export assignment.",
      "pattern": "^[a-zA-Z0-9][-_a-zA-Z0-9]*$"
    },
    "type": {
      "enum": [
        "Application",
        "Broker",
        "Adapter"
      ]
    },
    "summary": {
      "type": "string",
      "description": "A summary of functions this application provides."
    },
    "src": {
      "type": "string",
      "description": "File reference to package's main JavaScript module, relative to directory where pronghorn.json and package.json files are stored.",
      "pattern": "^[a-zA-Z0-9][.-_a-zA-Z0-9]*.(js|bin)$"
    },
    "encrypted": {
      "type": "boolean",
      "description": "When true, Pronghorn expects an encrypted main JavaScript module with a .bin filename extension."
    },
    "roles": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "description": "The allowed set of user roles the application's methods and views can specify.",
        "pattern": "^[a-z-A-Z0-9][.-_a-z-A-Z0-9]*$"
      }
    },
    "methods": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Object describing an application's method and its API.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Method's name. Must match prototype function name defined in JavaScript source.",
            "pattern": "^[a-z][a-zA-Z0-9]*$"
          },
          "display_name": {
            "type": "string",
            "description": "Text displayed in a workflow task's properties dialog."
          },
          "deprecated": {
            "type": "boolean",
            "description": "If true, method is deprecated.",
            "default": false
          },
          "summary": {
            "type": "string",
            "description": "A brief explanation of the method.",
            "maxLength": 50
          },
          "description": {
            "type": "string",
            "description": "Explain the method's purpose: what it does, what problem it solves, and why it was created."
          },
          "input": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Object describing a parameter.",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Parameter's name. Must match parameter's name defined in JavaScript source.",
                  "pattern": "^[a-zA-Z0-9][.-_a-zA-Z0-9]*$"
                },
                "type": {
                  "enum": [
                    "object",
                    "array",
                    "boolean",
                    "number",
                    "string",
                    "enum",
                    "*"
                  ]
                },
                "enumerals": {
                  "type": "array",
                  "description": "Only used when type is enum.",
                  "items": {
                    "type": "string",
                    "description": "An allowed value"
                  }
                },
                "description": {
                  "type": "string",
                  "description": "Describe the parameter's purpose."
                },
                "info": {
                  "type": "string",
                  "description": "A tooltip. Include references to other APIs that return the parameter."
                },
                "required": {
                  "type": "boolean",
                  "description": "When true, parameter is mandatory.",
                  "default": true
                }
              },
              "required": [
                "name",
                "type",
                "description"
              ]
            }
          },
          "output": {
            "type": "object",
            "description": "Describes the returned data.",
            "properties": {
              "name": {
                "type": "string",
                "description": "The outgoing variable name when method is called by a workflow job.",
                "pattern": "^[a-z-A-Z0-9][.-_a-z-A-Z0-9]*$"
              },
              "type": {
                "enum": [
                  "object",
                  "array",
                  "boolean",
                  "number",
                  "string",
                  "enum",
                  "*"
                ]
              },
              "enumerals": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "An allowed value"
                }
              },
              "description": {
                "type": "string",
                "description": "Returned value's description."
              }
            },
            "required": [
              "name",
              "type",
              "description"
            ]
          },
          "task": {
            "type": "boolean",
            "default": false,
            "description": "When true, method can be called by a workflow job."
          },
          "route": {
            "type": "object",
            "description": "When defined, enables a web API for the method.",
            "properties": {
              "path": {
                "type": "string",
                "description": "Final part of URL appended after namespace.",
                "pattern": "^(/[a-zA-Z0-9%][.-_a-zA-Z0-9%]*)+(/[:][.a-zA-Z0-9%][-_a-zA-Z0-9%]*)*$"
              },
              "verb": {
                "enum": [
                  "POST",
                  "GET",
                  "DELETE",
                  "PUT"
                ],
                "description": "HTTP request type."
              }
            }
          },
          "roles": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "description": "The allowed set of user roles for this method.",
              "pattern": "^[a-z-A-Z0-9][.-_a-z-A-Z0-9]*$"
            }
          }
        },
        "required": [
          "name",
          "summary",
          "description",
          "input",
          "output",
          "roles"
        ]
      }
    },
    "views": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Object describing an application's views.",
        "properties": {
          "path": {
            "type": "string",
            "description": "Final part of URL appended after namespace.",
            "pattern": "(^/$)|(^(/([-a-zA-Z0-9@:%._+~#=]{2,256}))+$)"
          },
          "deprecated": {
            "type": "boolean",
            "description": "If true, view is deprecated.",
            "default": false
          },
          "title": {
            "type": "string",
            "description": "Application name when type is view.",
            "maxLength": 50
          },
          "template": {
            "type": "string",
            "description": "Relative file reference to the view's HTML file.",
            "pattern": "^[a-zA-Z]([._-]|[a-zA-Z0-9])*(/[a-zA-Z]([._-]|[a-zA-Z0-9])*)*[.](jade|html)$"
          },
          "roles": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "description": "The allowed set of user roles for this view.",
              "pattern": "^[a-z-A-Z0-9][.-_a-z-A-Z0-9]*$"
            }
          },
          "type": {
            "enum": [
              "task",
              "view",
              "dialog"
            ],
            "description": "Manual workflow tasks are type task. Applications are type view. Modal application views are type dialog."
          },
          "variables": {
            "type": "object",
            "description": "A skeleton object holding the view's parameters and return data.",
            "properties": {
              "incoming": {
                "type": "object",
                "description": "A skeleton object holding the view's parameters."
              },
              "outgoing": {
                "type": "object",
                "description": "A skeleton object holding the view's returned data."
              }
            },
            "required": [
              "incoming",
              "outgoing"
            ]
          }
        },
        "required": [
          "path",
          "template",
          "roles",
          "type"
        ]
      }
    }
  },
  "required": [
    "id",
    "type",
    "encrypted",
    "roles"
  ]
}
```

## References

* [enum on npm](https://www.npmjs.com/package/enum)
* [enumify on npm](https://www.npmjs.com/package/enumify)
* [JSON schema: Enumerated values](https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values)
* [JSON schema validation: enum](https://json-schema.org/draft/2020-12/json-schema-validation)