# Request Approval

### Overview

The **Request Approval Component** allows human interaction within workflows by creating approval tasks that require manual decision-making. The component sends notifications to requesters and approvers and waits for an approval or rejection response.

### Usage

This component is used to introduce human decision points into an automated workflow, allowing designated approvers to review and approve or reject tasks.

#### Input Ports

| Port   | Description                                                                            |
| ------ | -------------------------------------------------------------------------------------- |
| `task` | Receives task details including title, description, requester, approver, and deadline. |

#### Output Ports

| Port       | Description                                                                      |
| ---------- | -------------------------------------------------------------------------------- |
| `created`  | Emits task details when a new approval request is created.                       |
| `approved` | Emits task details when the task is approved.                                    |
| `rejected` | Emits task details when the task is rejected.                                    |
| `due`      | Emits task details if the task reaches the decision deadline without a response. |

#### Properties

| Property      | Type     | Description                                                  |
| ------------- | -------- | ------------------------------------------------------------ |
| `title`       | `string` | Title of the approval request.                               |
| `description` | `string` | Description of the request.                                  |
| `requester`   | `string` | Email of the person requesting approval.                     |
| `approver`    | `string` | Email of the person who must approve or reject the request.  |
| `decisionBy`  | `string` | Deadline by which a decision must be made (ISO 8601 format). |

#### Processing Logic

1. **Receives Approval Request**: Accepts task details and creates an approval request.
2. **Sends Notifications**: Notifies the requester and approver via email.
3. **Waits for Response**: Listens for an approval or rejection decision.
4. **Processes Decision**:
   * If approved, sends the task details to the `approved` port.
   * If rejected, sends the task details to the `rejected` port.
   * If the deadline passes without a decision, sends the task details to the `due` port.

### Notes

* **Webhook Support**: Uses webhooks to listen for approval decisions.
* **Time-Sensitive Workflow**: Ensures decisions are processed before deadlines.
* **Workflow Control**: Useful for integrating human validation in business processes.

This component is essential for workflows requiring human approval, such as purchase approvals, compliance checks, or document validations.


---

# 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.appmixer.com/connector-configuration/utils/tasks/requestapproval.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.
