> ## Documentation Index
> Fetch the complete documentation index at: https://openops-ecb4f397-mintlify-helm-chart-documentation-30057.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Human-in-the-Loop

> How to request human approval and intervention in your workflows

Some workflows can run safely in unattended mode. Others, such as resource deletions, are more impactful and may require review by stakeholders before proceeding. To address this, OpenOps offers two Human-in-the-Loop mechanisms: [approvals](#requesting-approvals) and [notifications](#sending-notifications).

For example, you can create a workflow that flags idle RDS instances for review, prompting human approval before any scaling down or termination actions are taken.

## Requesting approvals

You can automate sending your stakeholders messages with actionable links or buttons and make your workflow stop executing until the receiver clicks one of these links or buttons. Depending on their choice, you can split the subsequent steps of your workflow into conditional branches.

OpenOps offers a dedicated approval request feature for Slack, as well as a more generic approval mechanism that you can use with other communication channels.

### On Slack

OpenOps provides several Slack-related actions:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/hitl-slack-actions.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=f175b883afb2cadc5d2affdcf33b876c" alt="Slack actions" width="649" height="373" data-path="images/hitl-slack-actions.png" />

#### With "Request Action"

One of Slack-related actions, **Request Action**, is the most straightforward way to request approval. It lets you build a Slack message with standard action buttons, send it to a chat or a public channel, and wait until the recipient clicks one of these buttons, signifying their decision:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/hitl-slack-request-action-properties.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=b69b728a9ca1bbea71a1b04cd3640dae" alt="Request action via Slack" width="486" height="766" data-path="images/hitl-slack-request-action-properties.png" />

When this action fires, the Slack user receives a message that you've defined in the action's properties. The message may look like this:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/hitl-slack-request-action-message.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=f11b0843c374104765f4bc5dbf180f9c" alt="Slack message with an action request" width="655" height="181" data-path="images/hitl-slack-request-action-message.png" />

As soon as the user clicks one of the buttons, your **Request Action** step receives this as the output. You can then create a [conditional branch](/workflow-management/conditional-branching/) with the **Split** action and implement distinct steps depending on which button the user clicked:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/hitl-slack-request-action-split.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=f17d45a0bed8af1f2260d4340daf367f" alt="Splitting based on a user action" width="786" height="618" data-path="images/hitl-slack-request-action-split.png" />

#### With "Send Message" and "Wait For User Action"

If you want to build approval requests with more customization options, you can use the **Send Message** action in the **Slack** group instead of **Request Action**.

The upside of **Send Message** is that it enables you to create approval requests using Slack's rich [Block Kit](https://api.slack.com/block-kit) UI framework.

However, **Send Message** doesn't wait for a reply from the recipient. Instead, use the **Wait For User Action** action and pass the output of **Send Message** to it. This allows the workflow to capture button clicks in the approval request. Once a button click associated with a decision is captured, you can then use the **Split** action to add workflow steps depending on the decision.

### Elsewhere

To request approvals through a communication channel other than Slack, use the **Approval** group of actions:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/hitl-approval-actions.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=d1eaabcb27ed1a1846c264d531ec29fd" alt="Approval actions" width="652" height="257" data-path="images/hitl-approval-actions.png" />

In this case, here's how you can create the approval part of your workflow:

1. Add the **Create Approval Links** action from the **Approval** group. This action generates two links: one for approval and the other for disapproval.
2. Add an action to message a stakeholder the two links. You can use **Send Email** under **SMTP** or one of the actions in the **Microsoft Teams** group.
3. Add the **Wait For Approval** action from the **Approval** group. Once the stakeholder clicks a link, this action updates the approval status accordingly.
4. Add the **Condition** action to take steps in case of approval or disapproval.

## Sending notifications

Besides approvals, you can also send notifications about completed workflows or steps. Some of the actions that enable sending notifications include:

* Actions in the **Slack** group:
  * **Send Message** to send a direct message or a message to a public Slack channel.
  * **Update Message** to update a message previously sent to a public Slack channel.
* **Send Channel Message** and **Send Chat Message** under **Microsoft Teams**:
  <img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/hitl-teams-actions.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=8ca15696248cce212e5e7f6e91f7eb09" alt="Microsoft Teams actions" width="618" height="337" data-path="images/hitl-teams-actions.png" />
* Actions in the **Jira Cloud** group, such as **Change Issue Status** and **Add Issue Comment**.
