Skip to content

Example: Leave request approval flow

In this example we move employees’ leave requests into Defthand. The flow will work like this:

  1. The employee submits the İzin Talep Formu (leave request form).
  2. An approval task goes to their direct manager. If the manager does not decide within 48 hours, the task passes to the next manager up.
  3. If the manager approves: if the leave is longer than 5 days, HR approves too; otherwise the request is approved.
  4. When the request is approved, the payroll team is informed.
  5. If a rejection comes at any step, the request is rejected.

Before you start:

  • You need permission to create and publish forms and flows.
  • Employees’ accounts must be linked to employee records, and their managers must be defined in the organization chart (see Organization and personnel).
  • Your organization must have employee groups with the codes IK (HR) and BORDRO (payroll).

Forms app → Form management → New form:

  • Title: İzin Talep Formu
  • Code: IZIN-TALEP
  • Create and design

Add these elements to a single page (Form designer):

Element Key Label Settings
Single choice izin_turu İzin türü Required. Choices: yillik Yıllık izin, mazeret Mazeret izni, ucretsiz Ücretsiz izin, hastalik Hastalık izni. Appearance: Radio buttons.
Date baslangic Başlangıç tarihi Required. Minimum: today(). Width: Half.
Date bitis Bitiş tarihi Required. Width: Half. Expression validator: bitis >= baslangic, Error message: Bitiş tarihi başlangıçtan önce olamaz.
Computed value gun_sayisi Gün sayısı Result type: Number, Format: Whole number, Unit: gün. Calculated value: dateDiff(baslangic, bitis, "day") + 1
Long text aciklama Açıklama Optional. Required when: izin_turu == "mazeret" (an explanation is required for excuse leave).

Click Save, Get ready to publish, Publish. Then Share → All employees → Save.

Workflows app → Workflow management → Yeni akış (new flow):

  • Ad (name): İzin Talebi Onayı
  • Kod (code): IZIN-ONAY
  • Açıklama (description): Yönetici onayı, 5 günden uzun izinlerde İK onayı, bordroya bilgi.
  • Başlangıç şablonu (starting template): Boş akış (empty flow)
  • Oluştur ve tasarla (create and design)

In the editor, choose İzin Talep Formu in the Bağlı form (bound form) field (so that you can pick fields from lists).

Adım ekle (add step) → Onay adımı (approval step):

Setting Value
Anahtar (key) yonetici_onayi
Görev başlığı (task title) İzin talebi: {submitter}, and Başlığa alan ekle (add field to title) → Başlangıç tarihi
Atayanlar (assignees) Atayan ekle (add assignee) → Gönderenin yöneticisi (submitter’s manager), doğrudan yönetici (direct manager)
Onay modu (approval mode) Biri (any one)
Yedek atayan (fallback assignee) Çalışan grubu (employee group) → IK
Eskalasyon (escalation) On. Süre (saat) (time, hours): 48. Süre dolarsa (if time runs out): Eskalasyon (mevcut) (escalation, current). Eylem (action): Yeniden ata (reassign). Target: Gönderenin yöneticisi, level 2.
Hatırlatmalar (reminders) On. İlk hatırlatma (first reminder) after 24 hours, then every 24 hours, at most 1 time.
Geri gönderme (send back) Off
Gönderen kendi talebini onaylayabilir (submitter may approve own request) Off
Onaylanırsa (if approved) (after adding step 2) uzun_izin_mi
Reddedilirse (if rejected) Reddedildi ile bitir (end as rejected)

Make sure the Başlangıç adımı (start step) is yonetici_onayi.

Adım ekle → Koşul adımı (condition step):

Setting Value
Anahtar (key) uzun_izin_mi
Tümü sağlanmalı (ve) (all must be met, and) Form alanı (form field) → Gün sayısı · büyüktür (greater than) · 5 (Sayı, number)
Sağlanırsa (if met) ik_onayi
Sağlanmazsa (if not met) bordro_bilgi

Adım ekle → Onay adımı:

Setting Value
Anahtar (key) ik_onayi
Görev başlığı (task title) Uzun izin: {submitter}
Atayanlar (assignees) Çalışan grubu (employee group) → IK
Onay modu (approval mode) Biri (any one)
Yedek atayan (fallback assignee) Kullanıcı (user) → your HR manager
Eskalasyon (escalation) Off
Geri gönderme (send back) On. Geri gönderilecek adım (step to send back to): Bir önceki onay adımı (varsayılan) (the previous approval step, default) (the manager)
Onaylanırsa (if approved) bordro_bilgi
Reddedilirse (if rejected) Reddedildi ile bitir (end as rejected)

First prepare the notification template: in the Communication section, create and publish a template with the “İş akışı görevi” (workflow task) scope, e.g. code izin-onaylandi-bordro, subject “Onaylanan izin”, with the submitter and the leave dates in the text.

Adım ekle → Bildirim gönder (send notification):

Setting Value
Anahtar (key) bordro_bilgi
Ad (name) Bordroya bilgi
Şablon (template) izin-onaylandi-bordro
Alıcılar (recipients) Çalışan grubu (employee group) → BORDRO
Dil (language) Kiracı varsayılan dili (organization’s default language)
Kanallar (channels) E-posta (e-mail)
Sonra (then) Onaylandı ile bitir (end as approved)

The flow sends the employee the “Talebiniz onaylandı” (“Your request was approved”) or “Talebiniz reddedildi” (“Your request was rejected”) notification by itself; no separate step is needed.

  1. Look at the diagram with Görünüm (view) → Tuval (canvas). It should look like this: Giriş → Yönetici onayı → (Onay) Uzun izin mi → (Evet) İK onayı → Bordroya bilgi → Onaylandı; Ret (reject) arrows from Yönetici onayı and İK onayı to Reddedildi; a Geri (back) arrow from İK onayı to the manager approval; no Süre dolarsa (if time runs out) arrow from the manager approval (escalation stays in the same step). No node should have an Erişilemiyor (unreachable) badge.
  2. Click Kaydet (save).
  3. Yayımla (publish) → Sürüm notu (version note): İlk sürüm → Yayımla.
  1. In the editor’s Form bağı (form binding) section, with İzin Talep Formu selected in Bağlı form, click Bu akışı forma bağla (bind this flow to the form).
  2. In the form designer, the badge now shows Akış: IZIN-ONAY (v1).
  1. With an employee account (e.g. Ayşe Yılmaz), open My forms → İzin Talep Formu:
    • İzin türü: Yıllık izin
    • Başlangıç tarihi: 15.12.2026; Bitiş tarihi: 26.12.2026 → Gün sayısı is calculated as 12.
    • Açıklama: Yılsonu izni.
    • Submit.
  2. In the submission, the Süreç (process) section shows Çalışıyor (running) and “Yönetici onayı · onay bekliyor” (manager approval · waiting for approval).
  3. Ayşe’s manager (e.g. Mehmet Demir) opens the task “İzin talebi: Ayşe Yılmaz, 15.12.2026” in My tasks and clicks Onayla (approve).
  4. Because the number of days is greater than 5, the task goes to the HR group. Someone from HR clicks Talep et (claim), then Onayla.
  5. An e-mail goes to the payroll group; the request becomes Onaylandı (approved) and Ayşe gets the “Talebiniz onaylandı” notification.

In the timeline you see, in order: Başladı (started), Görev atandı (task assigned), Onaylandı (approved), Koşul değerlendirildi (condition evaluated), Görev atandı, Talep edildi (claimed), Onaylandı, Bildirim gönderildi (notification sent), Tamamlandı (completed).

Also try a 3-day leave: after the manager’s approval, the HR step is skipped and the request is approved directly.