When should you use it?
- Leave requests arrive by chat or email and get lost
- Managers want the dates, reason and coverage in one place before saying yes
- You do not have an HR system with built-in approvals
Not for: Companies whose HR system already tracks leave balances and approvals; Medical or legally protected leave, which needs HR handling and privacy controls
What do you need, and what do you get?
You need
- An n8n instance
- The n8n form with name, email, dates, reason and tasks in progress
- OpenAI, Gmail and Google Calendar credentials
- The approver's email address and calendar
You get
- An approval email with a formatted summary
- An approval confirmation to the employee
- A booked ten-minute discussion when the request is not approved
How does it work, step by step?
- Import and connectImport the template and connect OpenAI, Gmail and Google Calendar.
- Adjust the formEdit the form fields to match your policy, such as half days or leave type.
- Set the approverPut the manager's address in the send-and-wait step and their calendar in the booking agent.
- Test both pathsSubmit one single-day and one multi-day request, approve one and reject the other, and read every email.
- Keep a recordAdd a step that logs each decision to a sheet or HR file so you have a history.
The prompt
The original prompt by Avkash Kakdiya (itechnotion), word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in n8n and ChatGPT. Values in lime are placeholders.
Original prompt by Avkash Kakdiya (itechnotion)
Role:
You are an HR Operations Assistant.
Input:
You will receive an array of objects containing employee leave request data in the following JSON format:
[
{
"Employee Name": "{{ $json['Employee Name'] }}",
"Email": "{{ $json.Email }}",
"From": "{{ $json.From }}",
"To": "{{ $json.To }}",
"Reason for the Leave": "{{ $json['Reason for the Leave'] }}",
"What Important tasks were you working on?": "{{ $json['What Important tasks were you working on?'] }}"
}
]
Rules & Logic:
1. If the "To" field is empty or null, treat the leave as a single-day leave on the "From" date.
2. If the "To" field is present, treat it as a multi-day leave from the "From" date to the "To" date (inclusive).
3. Read all the input data and generate a **professional summary** of the leave request instead of just copying the text.
4. Include in the summary:
- Employee Name
- Leave duration (single-day or date range)
- Reason for leave (summarized in professional wording)
- Status of ongoing tasks and how they are covered or handed over
5. Keep a **polite and professional tone** suitable for sending to Manager and HR.
6. Do not add any information not present in the input.
7. Output must be valid HTML content only.
8. Allowed HTML tags: <p>, <br>, <strong>, <b>, <em>, <ul>, <ol>, <li>, <span>, <div>
9. Do NOT include <html>, <head>, or <body> tags.
10. Generate exactly **two outputs**:
- `subject` → a concise email subject line
- `body` → the full HTML-formatted email content
Output Example:
subject:
Leave Approval Request – {{ $json['Employee Name'] }}
body:
<div>
<p>
<strong>Employee:</strong> {{ $json['Employee Name'] }}
</p>
<p>
<strong>Leave Duration:</strong> {% if $json.To == "" %}{{ $json.From }} (single-day leave){% else %}{{ $json.From }} to {{ $json.To }}{% endif %}
</p>
<p>
<strong>Reason for Leave:</strong> A summary of the employee's reason for leave in professional wording.
</p>
<p>
<strong>Task Status & Coverage:</strong> Summarize the important tasks the employee was working on and explain how they will be managed or covered during their absence.
</p>
<p>
Kindly review and approve or reject the leave request.
</p>
</div>Exactly as published by Avkash Kakdiya (itechnotion) in Automate employee leave approvals with GPT, Gmail & Calendar integration.
Our adapted version (optional)
Fill in the blanks (optional; the copied prompt uses your values)
Write a leave approval email for {manager_name} from this request. Return a subject line and an HTML body using only p, ul, li and strong tags. Employee: {employee_name} Start date: {start_date} End date (blank means a single day): {end_date} Reason given: {reason} Work in progress and who covers it: {handover} In the body, state the dates (say single day when there is no end date), give the reason in one neutral sentence without health or family detail beyond what is needed, and list each task with who covers it. If coverage is missing for a task, say so plainly. End by asking the manager to approve or decline. Use only the information above.
What can go wrong?
- People put health details in the reason field; tell staff what to write and keep the summary general.
- The sample email in the prompt uses a template tag that n8n does not process; it reaches the model as text, so test that single-day requests read correctly.
- The workflow does not check leave balances or overlapping absences; managers still need to.
- A rejection books a meeting automatically; let employees know so it does not feel like a summons.
Our take
A practical template for small teams that run leave on email and goodwill. The prompt is tight: it sets a single-day rule when the end date is blank, asks for a professional rewrite rather than a copy, limits the HTML to a few safe tags and says not to add anything the form did not contain. We ran it word for word on two synthetic requests, one single-day medical appointment and one eleven-day family trip with a payroll handover. Both summaries had the right dates, a neutral reason and a clear coverage line, used only the allowed tags and added nothing new. One quirk worth knowing: the example email in the prompt uses an if-tag that n8n does not process, so the model receives it as plain text. It still handled the single-day case correctly, but test yours. We would also keep health details out of the reason field and log every decision somewhere you can find later.
Where the time goes back: Managers stop chasing details over chat and decide from one email, and employees get an answer without having to ask twice.
FAQ
What does the manager see?
What happens on rejection?
Does it track how much leave is left?
Source and credit
The original prompt on this page is by Avkash Kakdiya (itechnotion), shown word for word with a link to where it was published. The summary, notes and adapted version are ours.
- Original
- Automate employee leave approvals with GPT, Gmail & Calendar integration
- Creator
- Avkash Kakdiya
- Published on
- n8n workflow templates
- Original date
- Dec 23, 2025
- License
- Not openly licensed; the original prompt is shown word for word with credit and a link to the original
- Originally for
- n8n
- AI dry run
- Oct 22, 2026: passed. Dry-run tested by our AI test agent on sample input. Noted the non-n8n template tag in pitfalls.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.