Skip to main content

Generate personalized tour itineraries via email with GPT-4o and Pinecone

Workflow preview

Workflow preview
100%
Generate personalized tour itineraries via email with GPT-4o and Pinecone preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

️ AI Based Tour Itineraries via Email Using OpenAI & Pinecone Vector Search Overview This workflow automates the process of handling new tour package requests received via email, analyzes the req...

Best for

  • Lead Nurturing automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.emailreadimap, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.toolvectorstore, @n8n/n8n-nodes-langchain.vectorstorepinecone, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.agent

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mohan Gopal.

Original n8n.io source

1.1 Workflow description

Title
Generate personalized tour itineraries via email with GPT-4o and Pinecone
Workflow name
Generate personalized tour itineraries via email with GPT-4o and Pinecone

🏖️ AI-Based Tour Itineraries via Email Using OpenAI & Pinecone Vector Search

Overview

This workflow automates the process of handling new tour package requests received via email, analyzes the request, and provides personalized tour package recommendations using AI and a vector database. It’s designed to streamline customer interactions and deliver quick, relevant responses.

Precondition

  1. Create a Embedded Tour Package Database (refer to the link below): Pinecone Database setup
  2. Register and create API Keys for OpenAI, Pinecone Database.
  3. Copy Mail Credentials to access Email Inbox from n8n node

This workflow automates the process of extracting tour information from PDF files stored in a Google Drive folder, processes and vectorizes the extracted data, and stores it in a Pinecone vector database for efficient querying. This is especially useful for building AI-powered search or recommendation systems for travel packages.

🛠️ Tools & Nodes Used

Email Trigger (IMAP): Monitors the inbox for new tour package requests. Text Classifier: Categorizes incoming emails (e.g., New Request, Follow-up, Other). Code Node: Extracts and structures relevant data from the email (subject, sender, content, etc.). Tour Recommendation AI Agent: An AI agent that interprets the request and formulates a prompt for package recommendations. OpenAI & OpenRouter Chat Models: Used for natural language understanding and generating responses. Simple Memory: Maintains context for ongoing conversations. Pinecone Vector Store: Stores and retrieves tour packages using semantic search. Embeddings (OpenAI): Converts text data into vector embeddings for similarity search. Answer Questions with a Vector Store: Retrieves the most relevant packages from Pinecone. Send Email: Sends the AI-generated recommendations back to the customer.

🔄 Process & Flow

Email Reception: The workflow starts with the Email Trigger (IMAP) node, which listens for new emails in the inbox. Classification: The Text Classifier node determines if the email is a new tour package request. Data Extraction: The Code node parses the email, extracting key details like sender, subject, and content. AI Agent Processing: The Tour Recommendation AI Agent receives the structured request and crafts a prompt for package recommendations. Vector Search: The agent queries the Pinecone Vector Store, which holds previously created tour packages, using OpenAI embeddings for semantic matching. Recommendation Generation: The AI agent selects the top 3 most relevant packages and generates a friendly, personalized response. Response Delivery: The Send Email node sends the recommendations back to the customer.

🚀 Recommendations & Improvements for Next Version Error Handling: Add error handling nodes to manage failed email parsing or AI response issues. Logging & Analytics: Integrate logging to track requests, recommendations, and customer responses for continuous improvement. Personalization: Enhance the AI agent to consider customer history or preferences for even more tailored recommendations. Multi-language Support: Add language detection and translation for international customers. Feedback Loop: Include a mechanism for customers to rate recommendations, feeding this data back into the system for improved future suggestions. Attachment Handling: Enable the workflow to process attachments (e.g., customer itineraries or preferences). Scalability: Consider batching or queueing requests if email volume increases.

💡 Conclusion

This workflow demonstrates how n8n, combined with AI and vector databases, can automate and personalize customer service in the travel industry. With a few enhancements, it can become even more robust and customer-centric!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Email Trigger (IMAP)

Type / Role
n8n-nodes-base.emailReadImap - emailReadImap
Config choices
Version 2

Block 2 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 3 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 4 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 5 - Answer questions with a vector store

Type / Role
@n8n/n8n-nodes-langchain.toolVectorStore - toolVectorStore
Config choices
Version 1.1

Block 6 - Pinecone Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.1

Block 7 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 8 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 9 - Tour Recommendation AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Format email content

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Route Workflow by Email Type

Type / Role
@n8n/n8n-nodes-langchain.textClassifier - textClassifier
Config choices
Version 1

Block 14 - Package Response Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

3. Summary Table

Workflow Generate personalized tour itineraries via email with GPT-4o and Pinecone
Complexity intermediate
Nodes 14
Categories Lead Nurturing, AI RAG
Author Mohan Gopal
Published 21 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5086/5086.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate personalized tour itineraries via email with GPT-4o and Pinecone do?

️ AI Based Tour Itineraries via Email Using OpenAI & Pinecone Vector Search Overview This workflow automates the process of handling new tour package requests received via email, analyzes the req...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Nurturing, AI RAG use case.