> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/processes/process-steps/process-step-settings/rules.md).

# Rules

Rules are special conditions that prevent a step from being proceeded.

Go to Process builder. Select a step to open [Step Settings](/processes/process-steps/process-step-settings.md) and expand **Rules**.

![](/files/f2b63e60b58da76b9950954fb5d41effefeb220d)

Click the **add** link to open the popup.

![](/files/81f3fa513bec8bb360156063231d1328df9cf9e3)

General configurations of a step rule are:

* **Name** — used just for comfort and does not affect rule execution.
* **Status** — rules can be active (working) or inactive (for example, temporarily disabled).
* **Error Message** — the user must enter the error message. It will be shown if the rule matches defined conditions.
* **Execute Before Step** — if checked, the rule will be automatically applied before the step becomes active and, if the rule matches, the step will get status "Pending". The error message will be shown as Status Reason in the proper step tab.

![](/files/54371c130299bac98276e8960f1302dd8ebd9a74)

![](/files/cd58a602542330ce7738cf23964ac2231ec04172)

A rule, if added, must have conditions configured, and they must return a boolean result (`true` or `false`).

{% hint style="info" %}
A rule prevents a step from further actions: an error message will be shown and the step will not be proceeded when the rule is matched (conditions return `true`).
{% endhint %}

Conditions can have different types:

* **Formula** — logical expression with boolean result.
* **Query** — takes a value from the specified object field. If more than one record matches query conditions, the first value will be taken.
* **Flow Step Status** — simply checks defined step(s) for one or several statuses. The user can select any step from any process.
* **Call Apex** — executes the specified Apex Class with given parameters and returns the result. The result should have boolean type.

See the [Work With Conditions](/automations/queries-and-conditions/working-with-conditions.md) chapter to learn about configuring conditions.

Save the configured rule. Rules will be shown in step properties. They can be **deleted**, added to the [library](/processes/process-actions/standard-actions-library.md), or edited by clicking the **rule name**.

![](/files/90e3423034a5662cf45b979c4d5f4793c1d05f16)

The **Clone** button will appear when the rule is being edited. After clicking it, the system will ask for the cloned rule name and target step (mandatory).

![](/files/e61f1c3ad0c12d649436e28ad612db4aa6f02029)

![](/files/1ce75c2bac2ffb3e44540e8dc2848d1b794ddf8f)

After clicking the **Apply** button, an edit form for the cloned rule will be shown.
