Spanish Total.js
English
Documentation For AI agents
Contents

Build a leave request process

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

.md Website
On this page

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:

FromOutputToInput
StartStartLeave requestNo data
Leave requestSendApprovalNo data
ApprovalApproveClosePayload
ApprovalExpireClosePayload

The finished process in the designer

5. Configure the nodes

NodeSettings
StartName Leave request
Leave requestWorkflow action Create, Workflow name Leave request, Template name Leave: {{ value.reason }}
ApprovalWorkflow action Step, Workflow name Approval, Expiration 3 days, Template subject Approved: {{ value.comment }}
CloseName 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.

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.
Made in Europe