Automate Appointment Booking & AI Email Labeling with n8n

Save hours by automating appointment bookings with Google Calendar and categorizing emails with AI in n8n. This workflow uses LangChain, Pinecone, and Slack to streamline scheduling and intelligent email handling effortlessly.
Slack
Embeddings OpenAI
Gmail
+17
Workflow Identifier: 1045
NODES in Use: Slack, Sticky Note, Code, Recursive Character Text Splitter, Embeddings OpenAI, Default Data Loader, OpenAI Chat Model, Vector Store Retriever, HTTP Request, NoOp, Vector Store Pinecone, Chat Trigger, Text Classifier, Gmail, If, Webhook, Anthropic Chat Model, Tool HTTP Request, Agent, Memory Buffer Window

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

Opening Problem Statement

Meet Max Tkacz, a busy Senior Developer Advocate at n8n. Max juggles dozens of appointments weekly, often losing precious time confirming availability and scheduling meetings manually. On top of that, Max receives a flood of emails—automation queries, music fan mail, and newsletters—scrambling to keep them organized is both time-consuming and prone to errors. Without automation, Max wastes countless hours every week handling these repetitive tasks, increasing stress and reducing productivity.

This specific situation is exactly what this n8n workflow addresses by automating appointment booking through Max’s Google Calendar and intelligently labeling incoming emails using AI classification. The result? Max regains focus on high-impact tasks and eliminates scheduling mishaps and miscategorized emails.

What This Automation Does

This workflow combines automation tools to solve two crucial pain points for Max:

  • Automatically categorizes incoming Gmail emails into “automation” or “music” labels, using AI text classification powered by LangChain and OpenAI’s GPT-4 model.
  • Sends Slack notifications with email information when a specific email arrives containing “@n8n” in the sender’s address.
  • Implements an AI-powered appointment booking assistant that interacts via chat, understands availability from Google Calendar, and books 30-minute meetings seamlessly.
  • Loads PDF whitepapers dynamically, extracts text, creates embeddings, and stores them in Pinecone vector database for AI-powered querying using GPT-4o.
  • Handles user chat inputs to answer questions based solely on the indexed PDFs, ensuring accurate and trustworthy responses.
  • Includes various sticky notes in the workflow for documentation and examples, supporting ease of understanding and extension.

With this setup, Max saves several hours weekly from manual scheduling and email triage, decreases errors from miscommunication, and enables powerful AI-driven knowledge access from technical documents.

Prerequisites ⚙️

  • n8n account to create and run workflows.
  • Google Gmail account with API access for email triggers and labeling. 📧
  • Slack account with OAuth2 credentials to send channel messages. 💬
  • Google Calendar account with OAuth2 credentials for free/busy querying and event creation. ⏱️
  • Pinecone account to store and retrieve document embeddings.
  • OpenAI API access (GPT-4o) and Anthropic API for chat and embeddings.
  • PDF files accessible via URLs to load and embed documents.

Optional: Self-hosting n8n is possible, for example using Hostinger.

Step-by-Step Guide

Step 1: Set up Gmail Trigger to Detect Incoming Emails

Navigate to n8n dashboard → click “Create Workflow”.

Add Gmail Trigger node named “On new email to Nathan’s inbox”.

Configure polling every minute to monitor new emails in Nathan’s inbox. This node continuously listens for incoming emails.

Expected outcome: Workflow triggers each time a new email arrives in the inbox.

Common mistake: Forgetting to enable the node (it’s disabled by default here).

Step 2: Use AI Text Classifier to Categorize Emails

Add the LangChain Text Classifier node named “Assign label with AI” connected to the Gmail Trigger.

Configure categories: “automation” for workflow-related emails and “music” for artist or music-related emails.

Input text set to “{{$json.text}}”, the email content.

Outcome: Each email is tagged with the appropriate category based on AI analysis.

Common mistake: Not mapping the correct email text field as input.

Step 3: Add Gmail Actions to Apply Labels

After classification, add two Gmail nodes named “Add automation label” and “Add music label.”

Configure each node to add the respective label to the email using the message ID from the trigger node.

Outcome: Labeled emails appear organized within Gmail.

Common mistake: Not passing the message ID properly.

Step 4: Webhook to Initiate Slack Notification on Specific Emails

Add Webhook node named “Webhook” with a unique path for external triggers.

Connect to an If node “Whether email contains n8n” that filters emails where the query email address contains “@n8n”.

Outcomes: Only emails from n8n domain trigger onward actions.

Common mistake: Incorrect string filter causing missed triggers.

Step 5: Execute JavaScript to Modify Data

Connect the filter node to a Code node named “Execute JavaScript” that adds a custom field “myNewField” with a value of 1 to every incoming item.

Code snippet to use:

// Loop over input items and add a new field called 'myNewField'
for (const item of $input.all()) {
  item.json.myNewField = 1;
}
return $input.all();

Expected outcome: Enhanced data payload including extra metadata.

Common mistake: Modifying the incorrect input type or forgetting to return data.

Step 6: Send Slack Message Notification

Add Slack node “Send message” configured with OAuth2 authentication.

Set channel ID to “general” (example: C079GL6K3U6) and message text to include the email from webhook data: Data from webhook: {{ $json.query.email }}.

Outcome: Slack channel receives notification about important incoming emails automatically.

Common mistake: Using wrong channel ID or missing OAuth2 setup.

Step 7: Load and Download PDFs for Knowledge Base

Insert a dummy node “PDFs to download” preconfigured with whitepaper metadata and file URLs.

Connect to an HTTP Request node “Download PDF” to fetch documents via URL.

Outcome: PDFs load into the workflow as binary data for further processing.

Common mistake: Invalid URL or missing binary data configuration.

Step 8: Split PDF Text into Chunks

Use Recursive Character Text Splitter node to split large PDF text into manageable chunks for embedding.

Configure chunk size as 3000 characters with 200 overlap.

Outcome: Text is segmented to optimize vector embeddings.

Common mistake: Setting chunk size too large causing memory issues.

Step 9: Generate Embeddings with OpenAI

Add Embeddings OpenAI node to convert split text into vector embeddings.

Outcome: Vector representations created for Pinecone insertion.

Common mistake: Missing API key or wrong model selection.

Step 10: Insert Embeddings into Pinecone Vector Store

Use Vector Store Pinecone node with “insert” mode and “whitepaper” namespace.

Outcome: Embeddings stored to allow semantic search.

Common mistake: Incorrect namespace or authentication errors.

Step 11: Chat Trigger to Receive User Queries

Add Chat Trigger node “When chat message received,” using LangChain’s open chat interface.

Configure initial message: “Hi there! 👋 I can help you schedule an appointment with Max Tkacz. On which day would you like to meet?”

Outcome: Ready to accept user requests for appointment booking or document queries.

Common mistake: Not setting public access for the webhook correctly.

Step 12: Retrieval and Q&A from Pinecone and GPT-4o

Chain nodes together: “Read Pinecone Vector Store” to fetch relevant documents & “Vector Store Retriever” to refine queries.

Connect to “Question and Answer Chain” node where user’s chat input is answered strictly based on vector store data.

Outcome: Accurate, context-aware responses powered by GPT-4.

Common mistake: Query not restricted to vector store causing hallucination.

Step 13: Appointment Booking Agent using AI & Google Calendar

Set up an Agent node “Appointment booking agent” configured with a system message about Max’s availability, 30-minute slots, and polite scheduling.

Integrate with Google Calendar Free/Busy tool node “Get calendar availability” to check open slots.

Use HTTP Request node “Book appointment” to create calendar events with user info.

Outcome: Users can chat to schedule appointments without conflicts.

Common mistake: Incorrect time zone or event format causing booking failures.

Step 14: Add Memory Buffer for Context in Chat

Use Window Buffer Memory node to retain last 10 interactions to improve the AI assistant’s context awareness.

Outcome: Smoother conversational flow in scheduling assistant.

Common mistake: Setting context window too small causes repeated info loss.

Customizations ✏️

  • Change Email Categories: In the “Assign label with AI” node, modify the categories array to add or replace categories. This instantly adapts email labeling to new topics.
  • Adjust Meeting Duration: In the “Appointment booking agent” system message, update the sentence about appointment length from 30 minutes to desired duration. Also modify the “Book appointment” node JSON body accordingly.
  • Slack Channel Notifications: In the “Send message” Slack node, change the channelId to alert a different channel or user group based on preferences.
  • Use Different AI Models: Swap OpenAI GPT-4o with Anthropic or other language models in chat and classification nodes for varied AI responses.
  • Add More PDF Sources: Include additional HTTP Request nodes and update the “PDFs to download” node with new URLs for a richer knowledge base.

Troubleshooting 🔧

  • Problem: “Slack message not sent”
    Cause: OAuth2 credentials missing or incorrect.
    Solution: Go to Slack node → Authentication → Reconnect or update OAuth2 credentials properly.
  • Problem: “Email label not applied”
    Cause: Wrong message ID or label ID mapping.
    Solution: Confirm message ID field is {{ $json.id }} and label IDs match Gmail account labels exactly.
  • Problem: “Appointment booking fails”
    Cause: Time zone mismatch or incorrect event JSON.
    Solution: Double-check “startTime” and “endTime” fields in the calendar booking node conform to expected ISO format and Europe/Berlin timezone.

Pre-Production Checklist ✅

  • Verify OAuth2 credentials for Gmail, Slack, and Google Calendar nodes.
  • Test Gmail Trigger with a sample email to ensure detection and labeling.
  • Confirm PDF URLs are accessible and binary data flows through download node correctly.
  • Test AI chat trigger by sending a message to confirm responsive Q&A and appointment assistance.
  • Check Pinecone vector store connectivity and insertion logs.
  • Backup workflow and save version before activating.

Deployment Guide

Activate the workflow in n8n by toggling the nodes online after configuration verification.

Monitor execution via n8n’s execution logs accessible on the dashboard.

This workflow can run on n8n cloud or self-hosted instances. For higher loads, consider deploying on dedicated infrastructure.

FAQs

  • Can I use Outlook instead of Gmail?
    Not directly in this workflow, since it relies on Gmail API specific trigger and labeling nodes.
  • Does using OpenAI and Pinecone incur extra costs?
    Yes, both have usage-based pricing. Monitor your API usage to control costs.
  • Is my data secure?
    All API connections use OAuth2 with encrypted authentication. Pinecone stores vectors securely following best practices.
  • Can this handle dozens of appointments daily?
    Yes, n8n and the external APIs scale well. Make sure your Pinecone and API plan align with expected volumes.

Conclusion

By deploying this unique n8n workflow, you have automated Max Tkacz’s appointment scheduling and smart email categorization, saving hours each week. You avoided scheduling conflicts and ensured every email lands in the right Gmail folder with AI precision.

Next, consider extending this workflow to include SMS reminders for appointments or integrating voice commands to request scheduling. Or scale your AI knowledge base by adding more document types like Word or Markdown files.

Happy automating your productivity!

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free