A guardrail is a set of parameters that delimit the range of action or set the bounds of
operation of a digital worker task. You create guardrails from the Build view
and reference them in your task instructions. Business users can then edit the values you input into
the guardrails from the Manage view.
Procedure
-
From the Build view of a task, select Guardrails.
The task that you select must be in draft for you to add or modify the guardrails.
- Enter a unique name for the guardrail.
You use this name to query the
guardrails from the instructions editor later. The name is also visible in the
Manage view for business users to modify the values, so ensure that you chose a
distinctive name.
- Define the action of the guardrail.
The action is a description that clearly
defines the intended purpose of the guardrail. Since business users manage the values of the
guardrail, they need to understand how the values affect the digital worker task.
For
example, if the guardrail sets a lower limit for promotional discounts, your description must
accurately describe this action.
- Select a value and a data type and begin entering values, where the attribute
threshold
takes the following values:
- Single value: the threshold is a numerical or string value. For example:
4 or very low.
- Range value: the threshold is an array with two numerical values. The first value of the
array is the minimum value of the range; the second value of the array is the maximum value of the
range. Both values are required, and the second value must be greater than the first. For example:
-1 and 4.
- Single value from a set: the threshold is an array with one numerical or string element.
When you create this guardrail, you specify the set of possible values, and the default value is
preceded by an asterisk (*). For example: low, average,
*high.
- Multiple values from a set: the threshold is an array with one or multiple numerical or
string elements. When you create this guardrail, you specify a set of possible values. For example:
[-57, *144.12, *186, 1024]. Ensure that the default values are preceded by an
asterisk (*).
The sets that you enter here are the options from which future users select when they manage the
guardrails.
- In the Instructions editor, query the guardrails:
task.getGuardrail('Name of
guardrail').threshold;
Example
In the following illustration, the guardrail Low risk loan has a value of
16000
:
![image shows a guardrail titled Low risk loan, with a value type number, and a default value 16000](../images/scrn_guardrails_create.jpg)
From the Instructions editor, you can query the Low risk
loan guardrail:
const lowRiskLoanThreshold = task.getGuardrail('Low risk loan').threshold;