Build an n8n Travel Agent with LangChain & Pinecone
Imagine having a smart travel agent that never sleeps, remembers every preference, and sends gorgeous itineraries straight to your inbox. That is exactly what the o3 mini Travel Agent template for n8n helps you build.
This workflow combines conversational AI, LangChain-style tools, OpenAI embeddings, Pinecone vector search, and Gmail to turn a simple chat message into a polished, HTML travel plan. In other words, your users tell it where they want to go, and your automation does the rest.
What this n8n Travel Agent actually does
At its core, this template listens for a chat message like:
“Plan a 5-day family trip to Hawaii leaving from New York.”
From there, it:
- Understands the request using a conversational LLM (via OpenRouter)
- Searches Pinecone vector stores for matching resorts, flights, and activities
- Assembles everything into a clear, HTML travel itinerary
- Sends the final plan to the traveler through Gmail
The whole flow is designed to feel like a human travel agent conversation, but automated and scalable.
Who this template is perfect for
You will get the most value out of this template if you are:
- A travel startup that wants fast, personalized trip plans without hiring a big support team
- A travel agency looking to pre-draft itineraries that agents can tweak and approve
- An automation builder or n8n fan experimenting with AI, vector search, and email workflows
If you want to turn vague trip ideas into structured, ready-to-send itineraries with minimal manual work, this template fits nicely.
How the workflow is structured (high-level view)
Let us walk through the architecture before diving into each node. The workflow is built around a simple but powerful pattern:
- Trigger: A “When chat message received” webhook kicks things off
- Language model: OpenRouter Chat Model handles conversation, intent, and final copywriting
- Memory: Window Buffer Memory keeps short-term context from the ongoing chat
- Tools: Pinecone-backed vector retrieval for Resorts, Flights, and Activities
- Embeddings: OpenAI embeddings node turns queries into vectors for semantic search
- Email delivery: A Gmail node sends the final HTML itinerary to the traveler
All of this is wrapped in a tool-using agent pattern, so the model can “decide” when to call which tool, then stitch everything into one coherent itinerary.
Node-by-node walkthrough of the Travel Agent
1. When chat message received (webhook trigger)
This node is where the conversation starts. It receives the traveler’s message, such as:
“Plan a 5-day family trip to Hawaii leaving from New York.”
The webhook passes the text and any metadata into the rest of the workflow, which then uses that information to plan the trip.
2. OpenRouter Chat Model (the conversational brain)
The OpenRouter Chat Model acts as your main language model. It is responsible for:
- Understanding constraints like dates, origin, group size, and preferences
- Extracting structured details from the free-form user request
- Writing the final text that will appear in the HTML itinerary
You can think of it as the “travel agent personality” that talks to the user and then writes up the final plan.
3. Window Buffer Memory (conversation context)
Travelers rarely get everything right on the first try, right? They will ask for changes, add constraints, or clarify details.
The Window Buffer Memory node stores recent messages so the agent can remember what was said earlier in the same conversation. This helps it:
- Avoid asking the same questions again and again
- Respect updated preferences or corrections
- Keep the conversation feeling natural and continuous
4. Embeddings OpenAI (turning text into vectors)
To match user requests with your travel data, the workflow needs semantic search. That is where the OpenAI embeddings node comes in.
It converts phrases like “family-friendly beachfront resort” into vector embeddings. Those vectors are then used to query Pinecone so the agent can find the best matching resorts, flights, or activities.
5. Pinecone tools for Resorts, Flights, and Activities
The workflow includes three separate Pinecone-backed tools:
- Resorts tool, pointing to a
resortsnamespace - Flights tool, pointing to a
flightsnamespace - Activities tool, pointing to an
activitiesnamespace
Each tool runs a vector search over its own namespace, returning the most relevant items based on the user’s preferences.
The agent is set up so that it must call all three tools before it builds the final itinerary. That way, it always has:
- Somewhere to stay
- Ways to get there
- Things to do at the destination
6. Send Itinerary (Gmail node)
Once the agent has pulled all the data and written the itinerary in HTML, the last step is to send it.
The Gmail node handles:
- Setting the email subject line
- Using the HTML itinerary as the email body
- Sending from a verified account via Gmail OAuth2
The result is a clean, formatted itinerary that looks great in the traveler’s inbox.
Step-by-step setup guide
Ready to get this running in your own n8n instance? Here is how to set it up from scratch.
1. Get n8n ready
- Install n8n and open the editor UI, or use n8n.cloud if you prefer a hosted version.
- Import the o3 mini Travel Agent workflow template into your workspace.
2. Configure your credentials
You will need a few API keys and OAuth credentials. In n8n, set up:
- OpenRouter API key for the chat model
- OpenAI API key for generating embeddings
- Pinecone API key and an index with these namespaces:
resortsflightsactivities
- Gmail OAuth2 credentials for sending itineraries via email
Make sure all of these are stored in the n8n Credentials section, not hard-coded into nodes.
3. Populate Pinecone with travel data
This is where your travel database comes in. For each of the three namespaces, add metadata documents that represent your offerings.
Each item should include:
- A short, clear description
- Relevant tags, for example:
family-friendlyadventurebeachfront
- Price information, if available
- Availability windows or date ranges
The better your metadata, the more accurate and useful the itineraries will be.
4. Customize the agent’s system message
Inside the template you will find a system message that guides how the agent behaves. This is your chance to:
- Match your brand voice and tone
- Define service rules and constraints
- Mention operational details like accepted payment types or preferred partners
Adjust this message so the travel agent feels like an extension of your product or agency, not a generic bot.
5. Test, tweak, repeat
- Run sample prompts through the workflow.
- Inspect the retrieved resorts, flights, and activities for relevance.
- Iterate on:
- The system prompt
- Tool settings, like number of results
- The HTML layout of the final itinerary
A few small tweaks here can make a big difference in how “human” and useful the final plan feels.
Example prompt and HTML output
Here is a sample prompt you might send into the workflow:
“Plan a 4-day romantic getaway to Miami for a couple, leaving from Boston, with beach time and a fine-dining night.”
And a simple example of the kind of HTML itinerary the agent might generate and email:
<html> <body> <h2>4-Day Miami Romantic Getaway</h2> <p><strong>Day 1:</strong> Arrival, check-in at Oceanview Resort. Sunset walk on the beach and dinner at Seaside Bistro.</p> <p><strong>Day 2:</strong> Morning beach time, afternoon spa, evening fine-dining reservation at Luxe Grill.</p> <p><strong>Day 3:</strong> Boat tour in the morning, art district visit in the afternoon, cocktails at rooftop bar.</p> <p><strong>Day 4:</strong> Relax, late checkout, recommended airport departure time: 3 hours before flight.</p> </body> </html>
In your own setup, you can extend this with images, links, pricing sections, or call-to-action buttons.
Best practices for a smooth travel automation
To keep your n8n travel agent reliable and user-friendly, here are some practical tips.
Keep itineraries focused and realistic
- Limit retrieval results to the top 3 to 5 items for each category so the itinerary does not become overwhelming
- Include rest periods and downtime, not just back-to-back activities
Handle data and credentials safely
- Always sanitize and validate email addresses before sending itineraries
- Store API keys in n8n credentials, never directly in node parameters
- Use version control for your workflow JSON so you can roll back after tests
Security & privacy considerations
Travel data is personal by nature, so it is important to treat it with care. A few guidelines:
- Use secure credential storage in n8n and rotate API keys regularly
- Mask or redact personally identifiable information in logs and debug outputs
- Offer an easy way for users to opt out or request deletion of stored preferences
- Confirm consent before:
- Sending emails
- Storing itinerary details long term
Testing checklist before going live
Before you roll this out to users, run through this quick checklist:
- Make sure the webhook triggers correctly when a test chat message is sent
- Verify the OpenRouter model extracts structured details like dates and party size
- Test embeddings to Pinecone searches and confirm the returned items match the prompt
- Send a test email with the Gmail node and check:
- HTML renders correctly
- Links and formatting look good on desktop and mobile
Deployment & scaling tips
Once your travel agent is working nicely in development, you can prepare it for real users.
- Run n8n in a secure, hosted environment with HTTPS enabled
- If usage grows, scale n8n horizontally and use a robust database like Postgres for workflow state
- Upgrade to a Pinecone production plan with enough capacity for your vector queries
- Monitor OpenAI and OpenRouter usage and set alerts so costs do not surprise you
Why this template makes your life easier
Instead of manually researching options, assembling day-by-day plans, and formatting everything into an email, you get a reusable automation that:
- Turns a single chat message into a structured trip
- Uses AI and vector search to pull in relevant travel data
- Delivers a ready-to-send HTML itinerary automatically
The o3 mini Travel Agent template is a practical and extensible starting point if you want to blend conversational AI, semantic search, and email automation into one user-facing experience.
Next steps
If you are curious how this would work with your own travel data, the best move is to try it:
- Import the template into your n8n instance
- Connect your OpenRouter, OpenAI, Pinecone, and Gmail credentials
- Run a few test prompts and refine the system message and HTML layout
If you want a more tailored walkthrough or help structuring your Pinecone index with resorts, flights, and activities, you can reach out to your team internally or work with a specialist and keep iterating. Once it is tuned, this workflow can quietly handle a lot of your travel planning workload in the background.
