Skip to main content
Version: 25.x

Building steps

The Step Library contains JavaScript-based workflow steps. Steps can be used inside Workflows and have access to the Avantra JavaScript API, with available methods depending on the type of monitored system the step runs on.

Creating a step

  1. Navigate to Automation > Step Library.
  2. Click New.
  3. Enter a Name and Namespace to name the step. The combination must be unique.
  4. Optionally, set a Customer to group the step in the Step Library.
  5. Click Create.

The step editor opens with a JavaScript editor on the left and configuration tabs on the right.

Parameters

Steps have parameters that can be used to pass information to and from the step. Parameters are configured in the Parameters tab. Every step has some built-in parameters the the workflow engine uses automatically. Custom parameters can be added as required.

ParameterDirectionDescription
systemIdInputThe monitored system the step runs on. Not accessible in JavaScript.
timeoutInputSeconds to wait before terminating a long-running step. Not accessible in JavaScript.
successOutputtrue if the step executed successfully.
messageOutputShort execution summary (shown in the execution log).
detailsOutputDetailed execution message (shown in the detailed execution log).

Adding a parameter

  1. Navigate to Automation > Step Library.
  2. Double click on a step.
  3. Click the Parameters tab.
  4. Click the **+** icon to add a row.
  5. Enter a unique Name (camelCase recommended).
  6. Set a direction: Input, Input (Mandatory) or Output.
  7. Choose a Parameter Type.
    Not all parameter types are available for Step Library step usage.
  8. Optionally set a Default Value and Documentation.

See JavaScript API documentation for more information about usage of parameters in JavaScript.

Documentation

Use the Documentation tab to describe the step's purpose, expected inputs, and any restrictions. This content is shown in the workflow builder when selecting or configuring the step.

Testing a step

The Test tab lets you test the output of a step.

  1. Navigate to Automation > Step Library.
  2. Double click on a step.
  3. Click the Test tab.
  4. Enter values for all inputs, including the mandatory systemId to select the agent to test on.
  5. Click Run script or Debug script.*
tip

To enable debugging, add JS_DEBUG=on to the AgentEnvironment monitoring parameter on the target agent. Debugging opens a URL for use in a Chromium-based browser.

The output parameters can be seen in the result text field.

Import and export

Use the Import and Export buttons to share steps between systems. See Workflow export for the file format of exports.