User Stages

Create user stages to customize and save stages for use within bot creation. Once created the stages are available for reuse on the Neurons Bots editor, under Stages > User .

To create a User Stage

  1. In Neurons Bots, select Create Bot.
  2. On the Create bot page, select Create for either Schedule or Custom action.
  3. On the New bots editor page, select Manage user stages to display the User Stage Manager page.
  4. On the User Stage Manager page select Create and the stage from the following:
    • PowerShell Query
    • PowerShell Action
    • Bash Action
    • Command Action
    • OSQuery
  5. On the User Stage Editor page, enter the Stage name. For example, Compress File/Folder.
  6. Optionally enter a description. The descriptive text displays when in the bot editor and Stage Information is selected from the Stage Settings panel. For example, This stage compresses source files from a specified path to a destination path to the specified compression level.
  7. Enter the script code.
    Example:
    Compress-Archive -path C:\logs\file.txt 
    -destinationpath C:\logs\file.zip 
    -compressionlevel Optimal

You can make this script more flexible by replacing some of the hard code with variables. This would allow elements to be customized when using the stage.
Example:
Compress-Archive -path __Path to Source File or Folder__
-destinationpath __Destination Path__
-compressionlevel __Compression level|options:Fastest,Optimal,No Compression_

Select Ctrl + Space to insert an Options Variable or a Value Variable:

  • An Options Variable is displayed in the settings as a select drop-down, the options available will be the ones you enter into the script. In this example: Compression level options Fastest, Optimal, No Compression.
  • A Value Variable is displayed in the settings as a text box, with the label you enter in the script. In this example: Patch to Source File or Folder, Destination Path, and Compression level.

For this example the Stage Settings would look like this:

custom stage settings

  1. Complete the Stage Settings, the settings available depend on the type of user stage you are creating:
  1. Select Apply and Close to save the user stage.
    If you have made edits to an existing user stage, a new version is created. On saving, a dialog displays to warn that any bots using the user stage will need updating to use the latest version.

Actions

You can perform the following actions to any of the user stages:

  • Clone: Select a user stage, select Actions > Clone. The Clone Stage dialog displays. Enter a unique name and select Clone. A pop-up message displays to inform you the stage creation was successful. The cloned stage appears in the list for you to select and edit.
  • Delete: Select one or more user stages, select Actions > Delete. The Delete stages dialog displays. Select Delete to confirm deletion of the stage. This action cannot be undone and will deprecate the stage from any bot that uses it. Deprecated stages are indicated by a red border.

Related topics

Neurons Bots Stages