Custom Stages

Bots can range from being short and simple to long and complex. You have the option to create custom stages to suit your needs by use of scripting. If you have a script that you will use regularly you can create the bot to be added to the User Stages section. Learn more about User Stages.

You can create custom stages using the following:

  • osquery: Use an osquery to discover information from your managed endpoints.
    You can specify whether the query supports singular or multiple results.
    Singular mode: variables from the query can be used in stages without a for each loop.
    Multiple mode: connect for each stage so that it can loop through the results that return multiple results per endpoint.
  • PowerShell Query: Use a PowerShell Query to discover information from your managed endpoints.
    Queries can be run in the security context of the end user or as System, or using Credentials. If you select "Credentials" you must choose user credentials from the Select connector for credentials drop-down. Choose credentials with the necessary permissions to allow your script to execute on target systems, considering any remote actions being invoked.
    The PowerShell Type can be selected from PowerShell, Core, or Auto. If the PowerShell core run time is installed it will execute the script against PowerShell core, otherwise it will execute it against PowerShell.
    You can specify whether the query supports singular or multiple results.
    Singular mode: variables from the query can be used in stages without a for each loop.
    Multiple mode: connect for each stage so that it can loop through the results that return multiple results per endpoint.
  • PowerShell AI: The PowerShell AI query stage generates a PowerShell script for use in a Bot’s workflow based on your provided prompt. The stage automatically maps outputs and assigns them data types (String, Number, Boolean, and Date). This structures and typecasts the data so it is accessible to downstream stages without requiring you to map outputs to variables first.
    Stage settings include a prompt field used to generate the PowerShell script. Inputs are supported, and their variables are incorporated into the generated script. You can also remove outputs you do not need or change their data types. When saving the Bot for the first time, you must accept the terms for the PowerShell AI query stage at the bottom of the Stage Settings panel.
  • Bash Action: Allows you to run custom Bash scripts on endpoints.
    Actions can be executed in the context of the end user or as the system. It supports workflow variables as inputs, making it easy to dynamically pass inventory attributes to scripts.
  • Bash Action AI: The Bash Action AI stage generates a custom Bash script based on your provided prompt. You can review, edit, and execute as part of your bot workflow. This stage supports user actions rather than operating autonomously. You remain responsible for validating the generated script before running it on target devices.
    Stage settings include a prompt field used to generate the Bash script. Inputs are supported, and their variables are incorporated into the generated script. When saving the bot for the first time, you must accept the terms for the Bash Action AI stage located at the bottom of the Stage Settings panel.
  • Command Action: Allows you to run a custom command on the endpoints, using Windows Command-line tools.
    Actions can be executed in the context of the end user or as the system. It supports workflow variables as inputs, making it easy to dynamically pass inventory attributes to scripts.
  • Command Action AI: The Command Action AI stage generates a custom command script based on your provided prompt. You can review, edit, and execute as part of your bot workflow. This stage supports user actions rather than operating autonomously. You remain responsible for validating the generated script before running it on target devices.
    Stage settings include a prompt field used to generate the Command script. Inputs are supported, and their variables are incorporated into the generated script. When saving the bot for the first time, you must accept the terms for the Command Action AI stage located at the bottom of the Stage Settings panel.
  • PowerShell Action: Execute PowerShell on endpoints within the bot.
    Actions can be run in the security context of the end user or as System.
    The PowerShell Type can be selected from PowerShell, Core, or Auto. If the runtime is installed it will execute the script against PowerShell core, otherwise it will execute it against PowerShell.

Related topics

Bots Stages

Bots Results