π₯ Automate employee leave approvals with GPT, Gmail & Calendar integration
β‘ 297 views Β· π₯ HR & Recruitment
Description
How it works
This workflow automates the complete employee leave approval process from submission to final resolution. Employees submit leave requests through a form, which are summarized professionally using AI and sent for approval via email. The workflow waits for the approverβs response and then either sends an approval confirmation or schedules a clarification discussion automatically. All communication is handled consistently with no manual follow-ups required.
Step-by-step
-
Step 1: Capture leave request, generate summary, and request approval
- On form submission β Captures employee details, leave dates, reason, and task handover information.
- AI Agent β Generates a professional, manager-ready summary of the leave request.
- OpenAI Chat Model β Provides the language model used to generate the summary.
- Structured Output Parser β Extracts the email subject and HTML body from the AI response.
- Send message and wait for response β Emails the summary to the approver and pauses the workflow until approval or rejection.
- If β Routes the workflow based on the approval decision.
-
Step 2: Notify employee or schedule discussion automatically
- Approved path
- Send a message β Sends an official leave approval email to the employee.
- Clarification or rejection path
- Booking Agent β Determines the next business day and finds the first available 10-minute slot.
- OpenAI β Applies scheduling logic to select the earliest valid slot.
- Get Events β Fetches existing calendar events to avoid conflicts.
- Check Availability β Confirms free time within working hours.
- Output Parser β Extracts the final meeting start time.
- Send a message1 β Emails the employee with the scheduled discussion details.
- Booking Agent β Determines the next business day and finds the first available 10-minute slot.
- Approved path
Why use this?
- Eliminate manual approval follow-ups and email back-and-forth
- Ensure consistent, professional communication for every leave request
- Automatically handle both approvals and clarification scenarios
- Reduce manager effort with AI-generated summaries
- Schedule discussions without manual calendar coordination
π Nodes Used
Gmail, AI Agent, OpenAI Chat Model, Structured Output Parser, n8n Form Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File