---
title: Build a leave request process
project: BPM
version: 1.0
section: recipes
language: en
license: Total.js Enterprise
url: https://totaljs.es/docs/bpm/1-0/recipes/leave-request/
updated: 2026-11-20T18:44:32.311Z
---

# Build a leave request process

> A complete process: a request form, an approval step in the Inbox and automatic closing.

This recipe builds a process where an employee asks for leave, a manager approves it in the Inbox, and the task is closed. Requests that nobody approves within 3 days are closed automatically.

## 1. Create the process

1. Open **Processes** and select **Create**.
2. Enter the **Name** `Demo process` and the **Category** `Demo`, then select **SUBMIT**.
3. Select the new card to open the designer.

## 2. Create the request form

1. Select the blue **+** button, enter the **Name** `Leave request`, choose **Default template** and select **SUBMIT**.
2. In the UI editor, drag a **Form** into the container and a **Textbox** into the form.
3. In the settings of the Textbox, set the name to `Reason`, the path to `reason`, and make it required.
4. In the settings of the Form, set the text of the button to `SEND`.
5. Drag a **Flow Output** into the container. Set its **Name** to `Send` and its **Target** to the submit of the form.
6. Select **SAVE** and close the editor.

## 3. Create the approval form

Repeat step 2 with the **Name** `Approval`, a field `Comment` with the path `comment`, the button `APPROVE` and a Flow Output `Approve`.

## 4. Draw the process

Reload the designer, then drag these nodes onto the canvas and connect them:

| From | Output | To | Input |
|---|---|---|---|
| **Start** | **Start** | **Leave request** | **No data** |
| **Leave request** | **Send** | **Approval** | **No data** |
| **Approval** | **Approve** | **Close** | **Payload** |
| **Approval** | **Expire** | **Close** | **Payload** |

![The finished process in the designer](/files/Jatkpu1du60f.webp)

## 5. Configure the nodes

| Node | Settings |
|---|---|
| **Start** | **Name** `Leave request` |
| **Leave request** | **Workflow action** Create, **Workflow name** `Leave request`, **Template name** `Leave: {{ value.reason }}` |
| **Approval** | **Workflow action** Step, **Workflow name** `Approval`, **Expiration** `3 days`, **Template subject** `Approved: {{ value.comment }}` |
| **Close** | **Name** `Done`, **Template result** `Approved` |

Select **APPLY** in each settings window, and then **APPLY** in the toolbar. Then select **Publish** in the toolbar, write `First version` in **What changed** and select **PUBLISH**. See [Process versions](../../guides/process-versions/).

## 6. Try it

1. Open **Inbox**, select **Create** > **Leave request**, type a reason, for example `Demo vacation`, and select **SEND**.
2. The task **Leave: Demo vacation** appears in the Inbox at the step **Approval**.
3. Select it, confirm **Assign**, type a comment and select **APPROVE**.
4. Open **Tasks**: the task is at the step **Done**, closed, with the result **Approved** and the subject **Approved: <your comment>**.
