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
- Navigate to Automation > Step Library.
- Click New.
- Enter a Name and Namespace to name the step. The combination must be unique.
- Optionally, set a Customer to group the step in the Step Library.
- 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.
| Parameter | Direction | Description |
|---|---|---|
systemId | Input | The monitored system the step runs on. Not accessible in JavaScript. |
timeout | Input | Seconds to wait before terminating a long-running step. Not accessible in JavaScript. |
success | Output | true if the step executed successfully. |
message | Output | Short execution summary (shown in the execution log). |
details | Output | Detailed execution message (shown in the detailed execution log). |
Adding a parameter
- Navigate to Automation > Step Library.
- Double click on a step.
- Click the Parameters tab.
- Click the
**+**icon to add a row. - Enter a unique Name (camelCase recommended).
- Set a direction: Input, Input (Mandatory) or Output.
- Choose a Parameter Type.
Not all parameter types are available for Step Library step usage. - 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.
- Navigate to Automation > Step Library.
- Double click on a step.
- Click the Test tab.
- Enter values for all inputs, including the mandatory
systemIdto select the agent to test on. - Click Run script or Debug script.*
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.