Bots Stages
Stages are used to build a bot. On the Bot editor page drag a stage on to the work area. The Stage settings panel displays for you to define the settings for the action or query. The stages must be connected
to create the workflow in the bot, refer to Connection settings. You can select a stage from the Stages categories. You can also create Custom stages and User stages for use with the bot.
Stage categories
The overview below does not list every individual stage. Listed stages may not be available in every configuration path.
Used to present and filter information from devices that meet the specified criteria. The output and context from this query stage can be passed through subsequent stages in the bot.
For example, show devices with less than 10% free disk space.
-
Teams call quality stage: The Teams call quality stage fetches call records with quality information for targeted devices or users. It assesses network performance, device compatibility, and overall call experience before or during live meetings, helping to identify potential issues.
To configure the Teams call quality stage:
-
Select the Teams call quality stage and go to Stage settings.
-
In the Select connector for credentials field, use the drop-down to select the connector to connect to Microsoft Entra ID.
-
From date and To date are optional fields; you can select the Custom value or Date now options. If you select the custom value option, enter the value, and if you select the date now, toggle the Add time to date to enter the Time unit and Duration.
This retrieves data from the last 30 days and a maximum of 60 calls per user.
-
-
Inventory Query: This stage retrieves values from the inventory based on user-selected filters and columns, which can then be used later in a Bot workflow. The retrievable attributes are limited to those with a single value (1:1 relationship); array-based attributes are not supported.
This stage exists in all Bot contexts, with dedicated stages also available within Universal context for both Device and People Inventory.When using the “to People context” or “to Device context” stage, failing to place the correct inventory query within the stage will result in an “invalid context” error.
-
Inventory Query (Advanced): This stage works in the same way as the Inventory Query stage but also allows the retrieval of array-based inventory attributes (1: many relationship). It exists in all Bot contexts, with dedicated stages also available within Universal context for both Device and People Inventory.
When using the “to People context” or “to Device context” stage, failing to place the correct inventory query within the stage will result in an “invalid context” error.
Action stages leverage Automation Fabric to perform actions. Use of variables is available for some actions. Learn more about Stage variables.
- Filter Results: You can filter query results based on customizable properties. Once you connect a built-in Query Stage to a Filter, the Property drop-down lists all available properties that can be selected. To view details of the properties, go to the query Stage Settings panel and select Stage Information.
- You can also use the Preview Query functionality to assess all targeted devices, and use the results table to view the format and range of values that can be filtered.
- You have the ability to join multiple queries together in sequence. If this is done, all results are combined and available to filter on, or use in Action Stages. You can change the comparison behavior of the connected filter so that it either applies either AND or the OR logic to determine the results.
- Join: Use this stage to re-merge a bot that has split down separate branches. In the Stage settings, select the join behavior; Any state, All succeeded, At least one succeeded.
- Set Variable: Use this stage to provide a consistent reference point that can be configured with default values and updated by stages based on results. This is useful when you want to use a single variable to reference a field which might be updated from queries across different branches. The variables that you can set are defined in Define variables.
-
Delay: Use this stage to set the workflow on hold for a predetermined amount of time. It delays the execution of the upcoming stage based on the time configured in the delay stage. In the stage settings, select the delay duration time in minutes, hours, and days. The maximum possible delay you can set is for seven days, and the minimum delay is one minute. This stage is helpful for waiting for a user to reply to a message or for a process to finish.
-
To device context stage: This stage is available when you choose Universal as a bot target type. Use this stage to switch from the people context or universal context to device context. In the stage settings, you can either create an input and then bind that to the Device name, or you can toggle it to List input mode. When you click the device context resizable stage, the stage library will dynamically change to the device context library. You can drag and drop a required stage from the stage library in the device context stage to gather data that can be used further outside of this device context. This format is useful for orchestration workflows when you want to sequence different actions across different devices as part of the same workflow.
-
Map List to List variable: This stage allows you to map data from a source list to a list variable. The Device Inventory Query stage, for instance, returns its results as a list. Use the Map List to List Variable stage to store these results in a list variable for later use within the bot or as an output for external processing.
To use this stage, select the destination variable of type, List. Next, select the source list also of a List type. The destination field appears after both the variables are selected. The available tokens represent only the values contained within the source list. This is useful when a previous stage returns a list of objects that can be stored as a variable for use later in the bot.
Prerequisites
-
You must have a list variable defined. See Bots editor for define bot variables.
-
The source data must be a list type output from a previous stage.
-
-
Append to List variable: The Append to List Variable stage adds a new value to the end of an existing list variable. This is useful when you want to build a list dynamically as the bot runs, such as collecting values from a loop or storing results from multiple stages.
Prerequisites
-
A List variable must be defined. See Bots editor for define bot variables.
-
The value being added should be compatible with the list's data type.
-
-
Cast to Type stage: The Cast to Type stage allows you to convert input values into a specific data type. This stage is useful when downstream stages or filters require values of a particular type, such as String, Number, Boolean, or Date.
For example, after extracting a number from a log message string, you can cast the output to an Integer and perform mathematical operations in downstream stages.If you need to convert an object to a string, use the To JSON stage instead.
Key capabilities are:
-
Boolean Conversation
-
Converts values such as 'true', 'TRUE', or '1' to the Boolean value true.
-
Only the exact value 1 is treated as true; decimal values such as 1.5 are not.
-
-
Date Conversation
-
Use the JavaScript Date constructor to convert supported string values into date objects.
-
-
Number Conversation
-
Performs a direct numeric conversion.
Example:-
Input: '23'
-
Output: 23
-
-
-
String Conversation
-
Converts values into their string representations because the input supports tokens. Multiple values can be combined into a single string.
-
-
-
JavaScript AI stage: The JavaScript AI stage combines the flexibility of the JavaScript stage with AI-assisted code generation, enabling users to create data transformations and business logic through prompts rather than manually writing code. The generated code can be reviewed, edited, tested, and reused within workflows.
The Stage settings include a prompt field used to generate the JavaScript code. It supports user-defined inputs, which can be referenced directly in the prompt. You can modify the prompt using the Open stage editor option. The changes must be applied and saved before testing in Test and get outputs.
When saving the bot for the first time, you must accept the terms and conditions for the JavaScript AI stage, located at the bottom of the Stage Settings panel.
As with all AI-related stages, this stage remains unavailable until the AI Powered Stages option has been enabled in Admin > Settings and users have been assigned an RBAC role that includes the Artificial Intelligence > Bots Generative AI Stages permission. -
JavaScript stage: The JavaScript stage allows you to execute JavaScript code as part of a workflow and does not run on an endpoint device. It is useful for manipulating data, performing calculations, formatting values, and generating structured outputs. This enables workflows to perform processing even when the target device is offline.
In Stage Settings, you can define one or more inputs for the stage. Input values are automatically available within the JavaScript code and do not require explicit variable declarations.
After entering your code in the JavaScript Editor field, click Test and get output to execute the code and view the output. The output is generated from the returned JSON and can be used as structured output by downstream stages in the workflow. The generated JavaScript can be modified using the Open stage editor option. The changes must be applied and saved before testing.This stage runs in isolation; therefore, its functionality is limited. For example, the ability to use JavaScript to call a web service would result in a connection failure.
Stages for early access are available here. Beta stages are offered to enable Ivanti to gather feedback and data around upcoming features.
Custom stages allow you to execute a custom script. You can choose from the following scripting templates:
- osquery: an open source SQL based language that can be used to query and retrieve information from devices and supports Windows and macOS devices.
- PowerShell Query: can be used to query Windows and macOS devices. It can run as system or logged-on user, or using specified credentials.
- PowerShell AI: can be used to generate and execute PowerShell scripts within Bot's workflow. It can run as system or logged-on user or using specified credentials.
- Bash Action: can be used to perform actions on macOS devices.
- Bash Action AI: can be used to generate and execute custom Bash scripts within Bot's workflow. It can run as system or logged-on user.
- Command Action: executes Windows command prompt commands on the target endpoint. It can run as system or the logged-in user.
- Command Action AI: can be used to generate and execute custom command scripts within Bot's workflow. It can run as system or logged-on user.
- Powershell Action: can be used to perform actions on Windows devices.
AI functionality is not available in the FRU landscape.
Learn more about Custom Stages
List function stages allow you to perform actions on stage results that are a list. You can, for example, filter, sort, count, or sum the list.
If the result of a List function stage is again a list, you can add another List function to further refine the result.
In the work area, you can recognize a stage that (is expected to) return a list result by the List tag.
To apply a List function stage in your workflow:
-
Add a stage that has a list result.
-
Add the desired List function.
-
Using
, connect the stages from step 2 and 3.
This will populate the value(s) for Select List on the List function stage. -
Select the List on which you want to perform the List function.
-
Depending on the List function, complete the remaining configuration of the stage.
-
Complete the rest of your bot workflow and save your changes.
The string manipulation stages allow you to transform, clean, validate, and extract information from string data as part of an automated workflow. They are intended to be used wherever a workflow requires working with data, such as checking string formats, extracting data from log messages, or building strings dynamically. Some of the stages include:
-
Extract String: Uses regex to match and extract strings from a block of text, returning the matched strings for use later in the workflow.
- Replace String: Allows replacing one value with another inside a string. The match can be done by explicit value or regex.
-
String Matches: Uses regex to match within a string, returning a true or false condition.
Interaction stages allow a bot to interact with and collect input from end users using Microsoft Teams. You can choose from the following interaction stages:
- MS Teams Interaction: Allows a bot to interact and collect input from an end user through Microsoft Teams. The message comprises a title, a message, and a choice of interaction: buttons or free text input.
- MS Teams Message: Allows a bot to send one-way messages to end users using Microsoft Teams. The message comprises a title and a message.
- MS Teams Rating: Allows a bot to interact and collect ratings from an end user through Microsoft Teams. The message comprises a title, a question, and a rating.
- MS Teams Sentiment: Allows a bot to interact and collect input from an end user through Microsoft Teams. The message comprises a title, a message, and a choice of interaction: buttons or free text input.
To learn more, refer to MS Teams Stages.
User stages are custom scripted stages. They are saved and made available in this User section for multiple reuse in bot creation.
Learn more about User Stages.
Microsoft Active Directory stages
The following stages manage user accounts in Microsoft Active Directory via the Microsoft Active Directory connector:
-
AD Update User: Modify user attributes.
- AD Assign Groups: Add a user to one or more AD groups.
-
AD Delete Account: Remove a user account.
-
AD Disable Account: Disable a user account.
-
AD Enable Account: Enable a user account.
-
AD Unlock Account: Unlock a user account.
These stages are currently available in the Universal and People context.
Prerequisites
Before using Active Directory actions, ensure the following:
-
A Microsoft Active Directory connector must be configured.
-
The connector must:
-
Have valid credentials for the target AD instance.
-
Support retrieving and managing users.
-
-
A connector must be selected for every AD action.
Configuration
When configuring an AD action:
-
Select Connector:
-
Choose a configured Microsoft Active Directory connector.
-
-
Specify Identification Type:
-
Define how the target user is identified (for example, SID (Security Identifier) or SAM (Security Account Manager) account name).
-
-
Provide Required Inputs:
-
Depending on the action, specify attributes such as:
-
Select optional fields to update (optional).
-
Groups to assign.
-
Edit Account Options.
-
-
All AD actions require both a connector and a user identification method to execute successfully.
Microsoft Entra ID stages
The following stages manage user accounts in Microsoft Entra ID via the Microsoft Entra ID connector:
-
Entra ID Enable User: Enable one or more Entra ID user accounts using the selected Neurons Entra connector, the same connector used to import the users into Ivanti Neurons.
-
Entra ID Disable User: Disable one or more Entra ID user accounts using the selected Neurons Entra connector, the same connector used to import the users into Ivanti Neurons.
-
Entra ID Delete User: Deletes one or more Entra ID user accounts.
-
Entra ID Update User: Updates one or more user attributes in Entra ID.
-
Entra ID Get User: Retrieves one or more user attributes from Entra ID.
-
Entra ID Get User Manager: Retrieves the manager details for one or more Entra ID users.
-
Entra ID Get User’s Groups: Retrieves the group memberships for one or more Entra ID users.
-
Entra ID Get Group Members: Retrieves the members of a specified Entra ID group. This stage is available in Universal context.
-
Entra ID Get Group Owners: Retrieves the owners of a specified Entra ID group. This stage is available in Universal context.
-
Entra ID Restore User: Restores one or more deleted Entra ID user accounts. Provided the accounts are within the 30-day soft-delete retention period.
-
Entra ID Set User Group: Adds or removes one or more users from a specified Entra ID group.
These stages may not make changes immediately available to subsequent stages. If a later stage depends on the updated data, consider adding a Delay stage to allow sufficient time for synchronization.
Prerequisites
Before using Entra ID stages, ensure that:
-
A Microsoft Entra ID connector is configured.
-
The connector is configured with valid credentials and the required permissions based on the action to access and manage Microsoft Entra ID resources.
-
The bot has access to the configured connector.
Configuration
When configuring an Entra ID action:
-
Select a Connector for credentials
Choose a configured Microsoft Entra ID connector as a credentials. -
Configure Stage-Specific Inputs
Enter any additional information required for the selected stage, such as:-
User (UPN or Entra ID)
-
Group (Names or Entra ID)
-
Additional Fields
-
Attributes
-
Additional User Fields
-
Entra ID
-
Stage variables
Variables can be used in the Stage settings to pass information between stages and pass the output of an action into the input of another action.
Inserting variables
To insert a variable open the Stage settings. Any field that supports variables will display the text Ctrl + Space. Select Ctrl + Space to select and insert a variable from the list.
When you define variables as script inputs in PowerShell, use the $myvar syntax to reference those variables within your script.
Bot Name: Name of the current bot.
Initiation User: Name of the user who initiated the bot. This will either be a user, or a Neurons service.
Initiation User ID: User ID of the initiating user. This will either be a user ID, or a Neurons service.
Timestamp (ISO): Current timestamp in ISO format.
Device Name: Gets the device name for current device within the current stage. Device names returned are separated by commas.
All Device Data: Gets all data for current device within the current stage. This will be a JSON object.
Given Name: Name of the logged on end user.
Display Name: Full name of the end user.
Email: Email for the end user.
There are templates ready to use with the variables. For more complex requirements, javascript is supported using handlebarsjs.
Stage settings
When you drag a stage onto the work area and it is highlighted, the Stage settings panel displays. Use the settings to configure and customize each stage.
You can customize the settings by using the User Stage scripting function. Learn more about User Stages.
Each stage is given a unique numerical ID. If the bot uses the same stage more than once, this ID can be used to identify the stages individually.
Click View stage information to display the Stage Information panel, which shows a description of the stage and all the associated properties. These can be used as criteria to filter the query results.
Enable the toggle for Result influences the DEX score to display the Surveys section on the device page.
If the settings for a stage have not been set correctly, or some information is missing, the stage will have a red border, as will the setting that needs attention. Once the setting has been correctly completed the red border is removed.
Deprecated stages
If a newer version of a stage in a bot is available, a yellow banner displays Action required: This bot contains x stage that has been deprecated. The border of the deprecated stage will be yellow.
Select Update to upgrade the stage to the newer version. Once complete, the banner is dismissed and the stage border will no longer be yellow.
Disabled stages
If a stage in a bot has been deleted and is no longer available, a red banner displays Action required: This bot contains x stage that has been disabled. The border of the disabled stage will be red.
You must remove the stage from the bot. Once complete the banner is dismissed.
Pinned stages
Use the Pinned category to group your most-used stages.
To pin a stage, hover over the stage, select the pin icon
.
To unpin a stage, click the pinned icon
.
Stage Information
Use the information
icon on any stage to display a description of what the stage does, operating system specific information, and settings details.
Rename stages
Use the rename icon on any stage to give it a custom name in the workflow. The text can be anything that you find helpful to explain that part of your bot and has persisted when the bot is saved. With the bot in edit mode, select the stage in the workflow and click the rename icon to display the Rename Stage dialog. After you have specified the name or description in the dialog, it will be displayed in the stage in the workflow. The stage text will also now include the default stage name, appended in brackets. The same combined text will also be shown in the Stage Settings panel, Stage Results view, and in the variable picker if you use any stage results as an input to another stage.
A maximum of 200 characters can be added in the custom name field.
New & Updated group
When a new stage is added or a stage is updated in a bot, these stages display in the New & Updated group for 30 days from the release date with a New or Updated green badge on the stage. After 30 days these stages will disappear from the New & Updated group and display in their actual group. This badge helps the user to identify the newly added stage and the legacy stage.
This badge will remain if the stage is in early access, regardless of the duration. Once a stage is enabled for everyone, the new or updated badge will be shown for 30 days before being removed.