Skip to content

Workflow Use Case Example: Leave Request Approval

This example demonstrates how to create a simple workflow to handle employee leave requests. The workflow uses conditional logic to route requests based on the number of leave days submitted by the employee.

Scenario:

When an employee submits a leave request:

  • If the number of leave days is 5 or more, the request is routed to the Manager for review and approval.
  • If the number of leave days is less than 5, the request is routed to the HR Representative.

Overview of the Workflow

  • Start Node with Start Form: The workflow begins when a user initiates the process by submitting a Start Form with basic details like request ID and name.
  • Task 1: The employee (assignee) submits a leave request form with details such as leave dates, reason, and number of leave days.
  • Decision Node: The workflow checks the number of requested leave days and routes the request accordingly.
  • Task 2: A task is assigned to the HR Representative to approve/reject requests of less than 5 days.
  • Task 3: A task is assigned to the Manager to approve/reject requests of 5 or more days.
  • End Node – The workflow ends after the final decision is recorded.

Steps to Create the Workflow:

  1. Create a New Workflow
    • Go to the Workflows page and click New Template.
    • Enter the workflow name (e.g., Leave Request Approval) and an optional description.
    • Set the Trigger Type to Manual.
    • Click Continue to proceed.
  1. Configure the Start Node and Start Form
    • In the Start Node, define a Unique Identifier Variable, for example: RequestID.
    • Click Design a Form to configure the Start Form.
    • Add the following fields:
Field LabelField TypeVariable Name
Requestor NameText InputRequestorName
    • Click Save, then Back to Task, and finally Continue to return to the canvas.
  1. Add Task 1: Submit Leave Request
    • Drag a Task to the canvas.
    • Task configuration:
      • Name: Submit Leave Request
      • Assignee: Select the employee or a relevant group.
    • Click Design a Form.
    • In the Form Builder:

Add the necessary input fields and define corresponding workflow variables. For example:

Form FieldField TypeVariable NameVariable Type
Employee NameTextEmployeeNameText
Leave TypeSelectLeaveTypeText
Leave Start DateDate PickerLeaveStartDateDate
Leave End DateDate PickerLeaveEndDateDate
Reason for LeaveParagraphLeaveReasonText
Total Leave DaysNumber InputTotalLeaveDaysNumber
Supporting DocumentsFile UploaderSupportingDocsText
    • After configuring the fields and mapping them to variables, click Save, then Back to Task.
  1. Add a Decision Node
    • Drag a Decision node onto the canvas and connect it to the leave request task (Task 1).
    • Double-click the Decision node to configure:
      • Name: Leave Approval Decision
      • Description (optional): Routes request based on number of leave days.
      • Decision Variable: Select TotalLeaveDays from the dropdown.
    • Click Continue.
  1. Add Task 2: HR Approval
    • Drag a third Task element to the canvas.
    • Configure:
      • Name: HR Approval
      • Assignee: HR Representative or HR Group
    • Click Design a Form and add:
Field LabelField TypeVariable Name
Approval StatusCheckboxHRApprovalStatus
HR CommentsText InputHRComments
    • Save the form and return to the canvas.
    • Connect this task to the Decision node.
    • Double-click the Decision node to set the Routing Condition:
      • Condition: TotalLeaveDays less than 5
      • Click Continue.
  1. Add Task 3: Manager Approval
    • Drag another Task element to the canvas.
    •  Configure:
      • Name: Manager Approval
      • Assignee: Manager or Manager Group
    • Click Design a Form and add:
Field LabelField TypeVariable Name
Approval StatusCheckboxManagerApprovalStatus
Manager CommentsText InputManagerComments
    • Save the form and return to the canvas.
    • Connect this task to the Decision node.
    • Double-click the Decision node to set the Routing Condition:
      • Condition: TotalLeaveDays greater than or equal to 5
      • Click Continue.
  1. Add the End Node
    • Drag an End Node onto the canvas.
    • Connect both Task 2 (HR Approval) and Task 3 (Manager Approval) to this node.

Final Workflow:

The final workflow starts with a Start Form, collects leave request data, and routes approval to either HR or Manager based on the number of leave days. Once the assigned task is completed, the workflow ends.

scrn-workflow-leave-request-approval
Leave Request Approval Workflow

All variables defined during task configuration are available under the Variables tab in the Workflow Properties pane.

scrn-workflow-variables-tab

Back To Top