AI-Powered Vacation Request Approval Automation

Thumbnail for Video
How the AI Flow works - AI-Powered Vacation Request Approval Automation

Flows

How the AI Flow works

Prompts used in this flow

Below is a complete list of all prompts used in this flow to achieve its functionality. Prompts are the instructions given to the AI model to generate responses or perform actions. They guide the AI in understanding user intent and generating relevant outputs.

AI Agent

An AI-powered Vacation Approval Agent that automates vacation request approvals based on specified business logic and interacts with calendar and email tools.

                You are an AI-powered Vacation Approval Agent triggered by the creation of a new event in a designated Google Calendar (e.g., "Vacation Requests"). Your role is to automate the vacation approval process based on predefined rules. Execute the following steps when a new calendar event is detected:

1. **Extract Event Details**:
   * Read the new event from Google Calendar.
   * Extract: employee name, department (from event description or title, e.g., "Vacation Request: Peter, Accounts"), requested vacation dates, and event ID.
   * Validate that the event is a vacation request (e.g., title contains "Vacation Request").
2. **Evaluate Request**:
   * Apply this rule: Only one employee from a department can be on vacation on the same day.
     * Check the calendar for existing approved vacation using the view events tool (e.g., events titled "Approved Vacation: [Employee Name]") on the same dates.
     * If another employee from the same department (e.g., Kamil from Accounts when Peter from Accounts requests) has an approved vacation on any of the requested dates, reject the request.
     * [Additional rules can be added here if provided, e.g., team capacity or leave type restrictions.]
   * Log the decision reasoning for transparency.
3. **Update Calendar (THE WAY YOU HAVE TO UPDATE THE CALENDAR IS TO CREATE A NEW EVENT WITH THE EXACT SAME DETAILS AND DATE AND TIME AND DELETE THE OLD ONE (THE ORIGINAL EVENT))**:
   * If approved, update the event title to "Approved Vacation: [Employee Name]" or set a specific status/color.
   * If rejected, delete the event from the calendar.
4. **Notify Employee**:
   * Send an email to the employee using their email address (from event description (event creator) or a predefined employee database) using the email notification tool.
   * Email details:
     * **Subject**: "Vacation Request Decision"
     * **Body**:
       * Approval: "Your vacation request for [dates] has been approved."
       * Rejection: "Your vacation request for [dates] was rejected because another employee from your department is already scheduled for vacation on those dates."

            

Components used in this flow

Below is a complete list of all components used in this flow to achieve its functionality. Components are the building blocks of every AI Flow. They allow you to create complex interactions and automate tasks by connecting various functionalities. Each component serves a specific purpose, such as handling user input, processing data, or integrating with external services.

Google Calendar Event Created

Integrate your workflows with Google Calendar. This component triggers automation when a new event is created in a specified Google Calendar, allowing you to seamlessly connect scheduling with other actions or notifications in your flow.

Parse Data

The Parse Data component transforms structured data into plain text using customizable templates. It enables flexible formatting and conversion of data inputs for further use in your workflow, helping to standardize or prepare information for downstream components.

LLM OpenAI

FlowHunt supports dozens of text generation models, including models by OpenAI. Here's how to use ChatGPT in your AI tools and chatbots.

AI Agent

The AI Agent component in FlowHunt empowers your workflows with autonomous decision-making and tool-using capabilities. It leverages large language models and connects to various tools to solve tasks, follow goals, and provide intelligent responses. Ideal for building advanced automations and interactive AI solutions.

View Events

The View Events component lets you fetch and filter calendar events within a chosen time range, leveraging Google Calendar integration. Ideal for automating workflows that need up-to-date scheduling data, it supports searching events, limiting results, and customizing attendee parameters.

Create Event

The Create Event component in FlowHunt lets you automate the creation of events in Google Calendar. Easily specify attendees, event time, description, and more, with options to generate Google Meet links and set reminders—streamlining scheduling in your automated workflows.

Delete Event

Easily automate the removal of events from Google Calendar with the Delete Event component. It connects directly to your calendar, enabling workflows to delete events and optionally notify attendees, streamlining calendar management within your flows.

Email Notification Tool

Thanks to the Email Notification Tool, your chatbots will generate leads and immediately notify your team.

Chat Output

Discover the Chat Output component in FlowHunt—finalize chatbot responses with flexible, multi-part outputs. Essential for seamless flow completion and creating advanced, interactive AI chatbots.

Flow description

Purpose and benefits

Let us build your own AI Team

We help companies like yours to develop smart chatbots, MCP Servers, AI tools or other types of AI automation to replace human in repetitive tasks in your organization.

Learn more

AI Meeting Scheduler with Google Calendar
AI Meeting Scheduler with Google Calendar

AI Meeting Scheduler with Google Calendar

This AI-powered workflow automates meeting scheduling through Google Calendar. Users interact with a chatbot that finds available times, creates, views, or dele...

3 min read
AI Email Assistant for Gmail
AI Email Assistant for Gmail

AI Email Assistant for Gmail

Automate Gmail inbox management with an AI agent that reads incoming emails, leverages your knowledge base to craft professional replies, and can send, label, o...

3 min read