# Tasks

"Tasks" is a feature that allows human interaction inside workflows. Any flow that requires non-automated approval can be easily built using this powerful module.

To understand how this module works, let's dive straight into a simple example.

Say we wanted to approve documents once they enter a specific folder in our Google Drive. Documents get manually or automatically sent to a specific folder which triggers a flow in Appmixer. This flow makes sure a relevant person gets notified and is incentivised to approve or reject the document. After the approval or rejection, the document is automatically sent either to the "Approved" or "Rejected" folder. A process that would be somewhat time-consuming is now a question of a single click.

Before we uncover all the steps required to build such a flow, let's start from the end and see what the flow looks like in Appmixer when it's complete.

![The complete flow in Appmixer](/files/-MfqqxTSvpirJf_K3G0K)

Let's see how we've built the flow from scratch. First, we need to set up the trigger. In this case, the flow starts every time a new file gets uploaded to the "Waiting for approval" folder in our G-Drive.

![Setting up the trigger](/files/-MfqvfkApYKHCJiBIOJK)

We want to notify the approver via email. Therefore, we need to use the "RequestApprovalEmail" component under the "Tasks" module. As said earlier, this module makes sure the relevant person receives an email where she can easily approve or reject the document. First, we set the Task title and Description.

![Setting up the Task Title and Description](/files/-MfqwpgiA3rwwYlLUEiw)

Next, we need to define the Requester and Approver emails.

![Setting up the Requester and Approver emails](/files/-MfqxJOa8USiJU4B7NQN)

Last but not least, we need to set the "Decision by" date. Here, we will use [Modifiers](/kb/appmixer-studio-features/using-modifiers-to-alter-data.md) and will set the due date to the time the document was created + 24 hours. In other words, the approver has 24 hours to approve the document after it's been uploaded to the "Waiting for approval" folder.

![Setting up the "Decision by" date](/files/-Mfqy4B_YVCISSKmj-8o)

Notice there are three paths from the Tasks component: approved, rejected, and due. As the names suggest, "approved" sets the path once the document gets approved, "rejected" allows you to set a different path in case the document gets rejected, and "due" helps you adjust the flow when the task is due. In our case, we want to notify the approver via SMS.

When the document gets approved, we need to export the relevant file from our G-Drive and upload it to the relevant folder.

![](/files/-Mfqyv3bbwvQonexTAk4)

Also, we want to send a Slack message every time a document gets approved.

![Setting up the Slack notification](/files/-MfqzkfzdMaXLY42ZOii)

Notice how we've used [Variables](/kb/appmixer-studio-features/using-variables-to-map-data.md) throughout the setup. Thus, we will make sure the flow works with the right file throughout the execution, and we get a notification on Slack with a better context (using the file name and web link in the message body).

Now when the "Approved" path is set, let's finalise the "Rejected" path. To save you a little bit of time, see the already set up path below. Needless to say, the process for similar to setting up the "Approved" path.

![Setting up the "Rejected" path](/files/-Mfr-P3aj7_4wc-YNhBI)

As stated above, we want to notify the approver via SMS when the task is due. This way, we reduce the risk of tasks being forgotten.

![Setting up the SMS reminder](/files/-Mfr0aeAfV7TqhcufvMW)

We're all set now. When we start the flow, upload a file to the "Waiting for approval" folder and the file gets approved or rejected, we should see in the [Logs](/kb/appmixer-studio-features/troubleshooting-errors.md) that the flow runs successfully.

![Checking in the Logs if the flow run successfully](/files/-Mfr1kJMTrPoxGtWf5YW)

**You may wonder, how does the approver approve or reject the documents?** Glad you ask. In this case, the approver can either hit the "Approve" or "Reject" button in an email that is sent as part of the "RequestApprovalEmail" component...

![New request for approval sent via email](/files/-Mfr22TQcWg4Mb982Ojh)

... or she can visit the "Tasks" dashboard where she sees all the tasks.

![Tasks Dashboard](/files/-Mfr2DkA32fWziSI-lL0)

As you can see, instead of logging into a G-Drive account, finding the right folder, opening a document, and then moving it into the right folder (Approved or Rejected), the approver hits a single button and Appmixer takes care of the rest. Simple, yet very powerful.

You may have noticed the other component under the "Tasks" module called "RequestApproval". This component works similarly to RequestApprovalEmail, but it allows you to set a specific path also when the task is created. For example, you may want to create a task in Asana. In this case, no email is sent. Instead of that, you use the links for approval/rejection and pass it to Asana (or any other platform).

![Using the RequestApproval component ](/files/-Mfr4nrn_wxX62Hi8T4n)

{% hint style="info" %}
Note that both these components are templates and are assumed to be adjusted for your specific needs. For example, you might want to use your own email provider, or use your own email template with your own branding and different wording.
{% endhint %}

Great job! You went through a pretty extensive example of how Tasks can be used. [Next, we'll look at another great module, Language.](/kb/appmixer-studio-features/utility-modules/language.md)


---

# 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/kb/appmixer-studio-features/utility-modules/people-tasks.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.
