# Human-in-the-Loop Steps

## Human-in-the-Loop (HITL) steps

**Types of Human-in-the-Loop steps**

Relay.app offers two kinds of HITL steps:

1. Request Approval (over Email or Slack)
2. Send input form (over Email or Slack)

When any of these steps are encountered during a workflow run, the run will pause and wait until the assignee of the step has completed their task (i.e., given the approval to continue, provided the missing data, etc.).

Human-in-the-Loop steps can be assigned to users in your Relay.app workspace. Assignees can be notified via interactive notifications over Slack or email when their action is needed in a HITL step. Each notification can be accompanied with a custom message with instructions.

#### Approvals <a href="#id-1-approvals" id="id-1-approvals"></a>

Approvals are the most basic Human-in-the-Loop step: they ask the assignee for approval to continue the run. When setting up this step, you can include any context (like variables) to aid the assignee in making the decision.

<figure><img src="https://cdn.sanity.io/images/1h9u8aig/production/8e3d1cecf0f6f065763f2656043913d7244b3e88-2100x948.png?w=3840&#x26;q=75&#x26;fit=max&#x26;auto=format&#x26;dpr=2" alt="" width="375"><figcaption><p>An approval step before an email is sent</p></figcaption></figure>

#### **Data Input** <a href="#id-2-getting-data-input" id="id-2-getting-data-input"></a>

Perhaps the most powerful Human-in-the-Loop step is ‘Get data input’. It sends a small “form” to the assignee and asks them to fill it out. You can add as many form inputs as needed, all typed data.

<figure><img src="https://cdn.sanity.io/images/1h9u8aig/production/72d1e179e2db795f60048cb4046aa5e291b2ba4d-2100x1050.png?w=3840&#x26;q=75&#x26;fit=max&#x26;auto=format&#x26;dpr=2" alt="" width="563"><figcaption><p>An example data input step that requests a Date</p></figcaption></figure>

## Setting up a HITL step

### **HITL step parameters** <a href="#hitl-step-parameters" id="hitl-step-parameters"></a>

All of the Human-in-the-Loop steps are easy to configure and share the same parameters:

* A **medium** to notify the assignee that action is required from them before the workflow run will continue. Assignees can be notified via either Slack or email.
* The **assignee** may be:
  * any member of the Relay.app workspace,
  * any email address
  * or a Slack channel.
* The **message** with optional instructions that the assignee will receive with their notification. These instructions may contain references to variable data from other places in the workflow.
* An optional **due date** for the action.
* Optional **additional reminders** to the assignee, for example, to notify them again three days after the initial notification was sent if they still haven’t acted on it.
* Optional **notifications to the run owner** (the Relay.app user that owns the workflow Trigger). For example, you may set up a run owner notification for every HITL notification that’s sent or when HITL actions are overdue.
* Optional **escalation behavior** for overdue HITL actions. By default, the step will just continue waiting for the user to act, but it can also be configured to do any of the following after the due date:
  * Skip the HITL action and continue to the next step.
  * End the workflow run right away and not execute steps after this one.
  * Reassign the HITL step to another workspace user.

<figure><img src="https://cdn.sanity.io/images/1h9u8aig/production/ab3a07ea07d4256589c7bfbbaa0abdc9bd5ab7f9-1400x1650.png?w=3840&#x26;q=75&#x26;fit=max&#x26;auto=format&#x26;dpr=2" alt=""><figcaption><p>Configuring the details of a HITL step</p></figcaption></figure>

### **Slack notifications** <a href="#slack-notifications" id="slack-notifications"></a>

Slack notifications for Human-in-the-Loop steps come from the Relay.app Slack bot and are interactive. This means that you can approve runs and even fill in data inputs right from Slack, even when you’re on the go! For example, if the medium of the HITL step is a Slack DM, the user can "Approve" directly within Slack. If the medium is a notification to a Slack Channel, any member of that channel can complete the HITL step.

<figure><img src="https://cdn.sanity.io/images/1h9u8aig/production/b7f98ea1209d5254d91d9e17a0be42ae8bcc14f2-1400x876.png?w=3840&#x26;q=75&#x26;fit=max&#x26;auto=format&#x26;dpr=2" alt="" width="375"><figcaption><p>Completing a HITL step from within Slack</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.relay.app/human-in-the-loop/human-in-the-loop-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
