Skip to content

Elements

The Elements page provides a suite of security and data manipulation funtionality. These "Elements" can perform actions like generating OTPs, creating passwords, hashing data, encrypting/decrypting information, and other utility functions. Each element can be associated with one or more agents, making them available for use within agent processes. When adding an element into a flow, you will use the standard authoring format, such as {"0":{"element":"generate password"}}.

Overview

The page allows for the following functionalities:

  • Add new elements: Define new security or data helper functions.
  • List existing elements: View elements available to a selected agent.
  • Edit existing elements: Modify the configuration of an element.
  • Duplicate elements: Quickly create a copy of an existing element.
  • Delete elements: Remove elements that are no longer needed.
  • Associate with agents: Control which agents have access to which elements.

Adding a New Element

To add a new element:

  1. Navigate to the Elements page.
  2. Expand the "New Element" section.
  3. Fill in the form with the following details:
    • Element Name: A unique name for the element (e.g., "GenerateUserOTP", "HashPassword").
    • Status: A toggle to activate or deactivate the element.
    • Agent(s): A multi-select dropdown to choose which agents can use this element.
    • Element Type: The type of operation the element will perform. The available types are: date, datetime, decrypt, encrypt, hash, isEmpty, otp, password, trim, uuid.
    • Input Variable: (Conditional) The variable containing the data to be processed (used for types like hash, encrypt, decrypt, trim, isEmpty).
    • Output Variable: The variable where the result of the operation will be stored.
    • Length: (Conditional) The desired length for generated password values. otp will have a fixed length of 6 digits.
    • Encryption Key/Secret: (Conditional) An optional key for encrypt and decrypt operations. It can be a static value or a variable (e.g., {var['secret_key']}). If left blank, a default account secret key is used.
  4. Click the "Create Element" button to save the new element.

Listing Elements

Existing elements are displayed in a list, filtered by the currently selected agent.

  • Each element in the list shows its name, type, status (✅ for active, ❌ for inactive), and the agents it's associated with.
  • You can expand each element to see more details, such as the input/output variables and other configurations.
  • Each element has buttons for Edit, Duplicate, and Delete.

Editing an Element

To modify an existing element:

  1. Click the "Edit" button next to the element you wish to change.
  2. A form will appear, pre-filled with the element's current settings.
  3. You can update any of the fields, including the name, status, associated agents, and type-specific configurations.
  4. Click "Save Changes" to apply the modifications or "Cancel" to discard them.

Duplicating an Element

To quickly create a copy of an element:

  1. Click the "Duplicate" button (content_copy icon) next to the desired element.
  2. A new element will be created with the same configuration as the original, but with " copy" appended to its name.
  3. You will be taken directly to the edit screen for the newly created copy to make any desired adjustments.

Deleting an Element

To remove an element:

  1. Click the "Delete" button (delete icon) next to the element.
  2. Confirm the action when prompted. The element will be permanently removed.

Adding an Agent to an Element

If you have an agent selected, you can easily associate existing elements with it:

  1. A form titled "Include an existing element for the '[Agent Name]' agent" will appear if there are un-associated elements.
  2. Select an element from the "Available Elements" dropdown.
  3. Click "Include Element" to grant the selected agent access to that element.

Quick Help - Element Configuration

Here is a guide to what each Element Type does:

  • date / datetime:

  • Description: Generates the current date (YYYY-MM-DD) or datetime (YYYY-MM-DD HH:MM:SS).

  • Output Variable: Stores the generated date/datetime string.

  • decrypt:

  • Description: Decrypts data from an input variable.

  • Input Variable: The variable holding the encrypted data.
  • Output Variable: Stores the decrypted (plaintext) data.
  • Encryption Key/Secret: Optional secret used for the decryption. This can be a static string or a dynamic variable from the session (e.g., {var["my_secret_key"]}) If left blank, the account client secret key will be used.

  • encrypt:

  • Description: Encrypts data from an input variable.

  • Input Variable: The variable holding the plaintext data.
  • Output Variable: Stores the encrypted data.
  • Encryption Key/Secret: Optional secret used for the encryption. This can be a static string or a dynamic variable from the session (e.g., {var["my_secret_key"]}) If left blank, the account client secret key will be used.

  • hash:

  • Description: Creates a one-way hash of a value. Ideal for securely storing passwords.

  • Input Variable: The variable with the plaintext to be hashed.
  • Output Variable: Stores the resulting hash.

  • isEmpty:

  • Description: Checks if a variable is empty (null, undefined, or an empty string).

  • Input Variable: The variable to check.
  • Output Variable: Stores the boolean result (true or false).

  • otp / password:

  • Description: Generates a random, secure string.

  • Length: For password, you can specify the length. otp defaults to a 6-digit number.
  • Output Variable: Stores the generated value.

  • trim:

  • Description: Removes leading and trailing whitespace from a string.

  • Input Variable: The variable containing the string to be trimmed.
  • Output Variable: Stores the trimmed string.

  • uuid:

  • Description: Generates a random Universally Unique Identifier (UUID).
  • Output Variable: Stores the generated UUID.