Animated data flow diagram

AI Chatbot Appointment Scheduler & Assistant

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI Microsoft Graph API / Outlook Langchain

Overview

Unlock Automated Scheduling & Customer Interaction with this AI Agent

This n8n workflow powers an AI Agent designed to act as an intelligent personal assistant for your business. It engages users through a chat interface, understands their needs, and seamlessly manages appointment scheduling. Structured around a sophisticated Langchain setup within n8n, the agent leverages OpenAI's GPT-4o model for natural conversation and uses integrated tools to interact with Microsoft Outlook Calendar for real-time availability checks and direct booking. It's skilled at gathering essential customer details and project information. If a user isn't ready to book or has complex queries, the agent can automatically draft and send an email to a designated team member for human follow-up, ensuring no lead is lost.

Key Features & Benefits:

  • Intelligent Appointment Scheduling: AI understands user requests for meeting times, checks your Microsoft Outlook calendar for free slots (respecting business hours and notice periods), and books appointments directly using Microsoft Graph API.
  • Real-time Calendar Integration: Fetches calendar events from Microsoft Outlook to provide accurate availability and avoid double bookings.
  • Automated Information Gathering: Proactively asks for customer name, company, email, and the purpose of the meeting, ensuring you're well-prepared.
  • Natural Language Conversation: Powered by OpenAI's GPT-4o for fluid, human-like interactions, enhancing user experience.
  • Contextual Memory: Utilizes Langchain's Window Buffer Memory to remember previous parts of the conversation for a more coherent dialogue.
  • Smart Escalation: If an appointment isn't suitable or the query is complex, the agent can send a detailed email notification via Microsoft Outlook to a human for follow-up.
  • Customizable Assistant Persona: The AI's behavior, including its responses and rules (e.g., business hours, appointment notice, founder's name), is defined by a detailed system prompt in the AI Agent node that you can tailor.
  • Streamlined Lead Qualification: Gathers preliminary project details during the chat interaction, aiding in lead qualification even before a meeting or human interaction.

Use Cases

  • For B2C E-commerce: Automate appointment booking for personalized shopping consultations or support sessions, improving customer engagement and conversion rates.
  • For B2B SaaS: Streamline demo bookings and sales consultations, ensuring leads are quickly engaged and qualified by an AI assistant that understands your calendar.
  • Reduce administrative overhead by automating the entire appointment scheduling process, from initial query via chat to a calendar invite in Outlook.
  • Enhance lead nurturing by having the AI gather key prospect information and project details during the chat interaction.
  • Provide 24/7 assistance for booking inquiries via your website, capturing leads and scheduling meetings even outside business hours.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • OpenAI API Key with access to a suitable model (e.g., gpt-4o-2024-08-06 or newer).
  • Microsoft Outlook (Business) account and configured OAuth2 credentials in n8n for calendar access (read/write via Microsoft Graph API) and email sending.
  • A chat widget or interface on your website capable of sending POST requests to the n8n webhook URL provided by the Chat Trigger node. Ensure your chat client can pass a unique sessionId for conversation memory.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure the 'OpenAI Chat Model' node: Enter your OpenAI API Key and select your desired model (e.g., gpt-4o-2024-08-06).
  4. Configure Microsoft Outlook Credentials: In the 'Make Appointment' (HTTP Request to Graph API), 'Get Events' (HTTP Request to Graph API), and 'Send Message1' (Microsoft Outlook node), select or create your Microsoft Outlook OAuth2 credentials. Ensure these credentials have permissions for Calendars.ReadWrite and Mail.Send (or equivalent) via Microsoft Graph.
  5. Customize the 'AI Agent' System Prompt: Review and modify the system message in the 'AI Agent' node. Key customizations include:
    • Business name (nocodecreative.io in the template) and founder's name (Wayne in the template).
    • Desired assistant persona and specific operational rules.
    • The current date and time placeholder {{ new Date()... }} which dynamically inserts the current UK date/time. Adjust if your primary operational timezone is different.
    • The fallback email tool description to correctly reference your founder's name.
  6. Review and Customize Tool & Action Nodes:
    • 'Make Appointment' (toolHttpRequest node): Verify the JSON body for creating events. Adjust the timeZone (e.g., Europe/London) if needed. The tool description also mentions <timezone> - ensure consistency.
    • 'Get Events' (httpRequest node): Check query parameters like startDateTime, endDateTime. The Prefer: outlook.timezone="Europe/London" header should match your primary calendar's timezone.
    • 'freeTimeSlots' (Code Node): Business hours are hardcoded (e.g., 08:00:00Z - 17:30:00Z). Adjust the JavaScript if your business hours or slot-finding logic differs.
    • 'Send Message1' (Microsoft Outlook node): Update the toRecipients email address to your internal contact. Customize the HTML email body if desired.
  7. Tool Workflow Configuration: The 'Get Availability' and 'Send Message' Langchain toolWorkflow nodes are designed to trigger specific paths within this same workflow via the 'Execute Workflow Trigger' and 'Switch' nodes. This self-referencing setup usually works without explicit workflow ID changes if imported correctly. Ensure the route parameters (availability, message) are handled as expected by the Switch node.
  8. Chat Integration: In the 'Chat Trigger' node, copy the Webhook URL (Test or Production). Integrate this URL with your website's chat widget or any platform that can send POST requests (e.g., containing chatInput and sessionId in the JSON body).
  9. Test Thoroughly: Interact with the chat interface using various scenarios: book an appointment, ask for availability, test edge cases like unavailable times, and trigger the email escalation path.
  10. Activate the workflow.

Tags:

AI AgentChatbotAppointment SchedulingOpenAIMicrosoft OutlookCalendar AutomationLead GenerationCustomer ServiceAutomation

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation