Neuron Workflow Builder

A Neuron workflow is made from a series of connected stages designed to automate various business processes and can be used to discover, provide insight, and take action. You can create a custom Neuron workflow from scratch or edit a pre-built one to customize it to your business needs using the Neuron Builder.

Neuron Settings

Use the Neuron Settings settings icon panel to configure the Neuron workflow. The settings available depend on the type of Neuron.

My Stages

The My Stages panel on the left contains all of the default and installed stages. There are different categories of stages:

Additional queries and actions can be found in the Library and added to My Stages. For more details on the Library go to Neurons.

  • Query: Used to present and filter information from devices which meet the specified criteria. For example, show devices with less than 10% free disk space. The output and context from this query stage can be passed through subsequent stages in the Neuron workflow. Each query contains a setting which allows the behavior of the Neuron to be controlled when results are not returned. By default Neuron will only continue if results are returned is selected. This means that if no results are returned from online devices, the Neuron workflow will progress no further. If this checkbox is cleared, the Neuron workflow will continue to progress, for example; this may be useful for raising an alert for positive confirmation that an issue has not been seen.
  • Action: Action stages leverage Automation Fabric to perform actions such as sending email, or executing custom PowerShell on user devices. Use of variables is available for some actions. See Variables for details.
  • Common: Includes:
    • Filter Results: Filters the captured query information as defined by the filter properties. See Filter for details.
    • Neurons Alert: Designed to generate alerts on the Neurons homepage.
  • Custom: Leverage Bash Action, Custom JavaScript, PowerShell Action and Query, and osquery to allow you to create bespoke actions and queries. Any custom stages created in the Library > Stage Editor appear here once installed.

Examples of how to use osquery and PowerShell are available in Neuron Workflows Advanced Examples.

Workspace

Drag stages over to the workspace to build the Neuron workflow. Click on a stage to show the following options:

remove click to remove the stage from the Neuron.

connect click to add a connector to another stage.

a pair of scissors click to break the connection between stages.

Stage Settings

When you drag a stage onto the workspace and it is highlighted the Stage Settings panel opens, use the settings to configure and customize each stage.

Click Stage Information to see a description of the stage and all the associated properties. These can be used as criteria to filter the query results.

Connection

Each stage must be connected to another stage so that the Neuron workflow can run. Highlight a stage and click and drag the connector arrows connect to the stage you want to connect it to. The Connection panel opens where you can customize the connection type and style and the line thickness and style. You can also amend the color and add a label.

Filter

You can filter query results based on customizable properties. When 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.

It is also possible to connect a filter stage after an Action to filter based on the action result. Results can vary based on the action. You can view the output by clicking on an action stage that has previously run in the run history section.

Custom queries such as osquery, PowerShell and BASH do not automatically populate the filter properties – These must be manually entered based on the column names returned by the query (or viewed in Preview Query).

You have the ability to join multiple queries together in sequence. If this is done, all results are combined and available to filter upon, or use in action stages such as Send Email and Create ISM ticket. 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.

Neuron workflow builder showing stages and settings

Variables

Variables can be used to pass information between stages and pass the output of an action into another action. Variables can be used for the following stages:

  • Neurons Alert
  • Send Email
  • Create Ticket (ISM)

Inserting Variables

To insert a variable open the Stage Settings for one of the appropriate stages; Neurons Alert, Send Email, Create Ticket (ISM). In the relevant fields use the keyboard shortcut (Ctrl+Space) to open the drop-down list of available variables and select the one you want to use:

  • Neuron Name: [[Workflow.Name]] - the name of the Neuron e.g. Blacklisted Software
  • Group Name: [[Workflow.Assistant]] - the name of the Neurons category the Neuron lives under e.g. Compliance
  • NeuronURL: [[Workflow.Url]] - a link to the unique Run # instance for the Neuron
  • Initiation User: [[Initiation.User]] - the name of the user that ran the manual instance
  • Initiation User ID: [[Initiation.UserId]] - the ID of the user that ran the manual instance
  • All Device Names: ${Ivanti.Devices} - a list of device names that were returned by the query separated by comma
  • All Device Data: ${Ivanti.Results} - a list of all device data that was returned by the query
  • Device Count: ${Ivanti.Results.length} - the number of devices that were returned by the query
  • Coverage - Responded: the number of devices that responded
  • Coverage - Errors: the number of devices that failed to respond, with errors
  • Coverage - Percent: the percentage of devices that responded

There are ready to use templates using the variables. For more complex requirements the fields in Neurons Alerts and Emails support javascript but this uses handlebarsjs

Managing errors

Ideally, all of your Neurons will run successfully on all of the devices you target every time. However, sometimes not everything will succeed. Neurons workflows include some features to improve the success rate, and there are some design decisions and configuration settings you can make to improve the success rate and help you to manage any errors that do happen.

Timeouts

There is a balance to be made between waiting for a workflow to complete and not leaving it to continue long after it has failed. Appropriate timeouts are applied to each stage of a workflow. Query stages have a timeout of 15 seconds, Actions 5 minutes, and Targeted Actions 25 minutes.

Skipping runs

Scheduled runs start only if the previous run has completed. The Run Log for a Neuron indicates a skipped run with skipped icon.

Error branching

When a stage runs, the workflow records on which devices the stage was successful and on which it failed. You can see these results in the Stage Output. If the stage is successful on only some of the targeted devices, both the stage and the run are marked as partially successful partially succeeded icon and the workflow progresses for just those devices that the stage succeeded for. You can improve your workflow design to more proactively handle this situation by adding error branches.

To add an error branch:

  1. Open the required workflow.
  2. From the My Stages panel, in the Common section, add a Filter Results stage below an Action stage.
  3. Connect the Action stage to the Filter Results stage.
  4. Click the Filter Results stage.
  5. In the Stage Settings panel, set Logic to AND, Property to Action Status, Comparison to Equals and Value to Failed.
  6. Connect a similar Filter Results stage to the same Action stage but with the Value set to Completed.
    You now have an error branch that separates successful devices from failed devices.
  7. Under the Completed Filter Results stage, complete your workflow design.
  8. Under the Failed Filter Results stage, add a Send Email action stage to report the failures, or add another appropriate action to try to progress the workflow.

Neuron Workflows Advanced Examples

The following examples demonstrate how you can build up a Neuron workflow and make use of the custom queries and actions:

Related topics

Neurons

Neurons for Healing

Neurons Workspace