This workflow corresponds to n8n.io template #4917 — we link there as the canonical source.
This workflow follows the Chainllm → Emailsend recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "UlSHcKupAZfb0FZt",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "AI Travel Agent",
"tags": [],
"nodes": [
{
"id": "6f0a745d-aa01-4edd-ac2a-444de56e8c60",
"name": "Ollama Model",
"type": "@n8n/n8n-nodes-langchain.lmOllama",
"position": [
-300,
80
],
"parameters": {
"model": "llama3.2-16000:latest",
"options": {}
},
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "261ba61b-5c01-4cd3-8033-41db9ad2b625",
"name": "Trigger From Mail (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-500,
-120
],
"parameters": {
"options": {
"customEmailConfig": "[\"UNSEEN\", [\"SUBJECT\", \"itinerary\"]]"
}
},
"credentials": {
"imap": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "750101d2-7fc0-44d7-a615-d98803669ff2",
"name": "Basic LLM",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-300,
-120
],
"parameters": {
"text": "={{ $json.textPlain }}",
"messages": {
"messageValues": [
{
"message": "=Create a friendly, human-style travel itinerary based on the email content in {{ $json.textPlain }}. The itinerary should be casual, easy to read, and feel like it was written by a person \u2014 not a robot.\n\nInclude the following elements:\n\nA short, warm greeting at the top\n\nA one-line summary of the destination and a few top highlights mentioned in the email\n\nAlways Daily breakdowns starting with \"Day 1:\", \"Day 2:\", etc., matching the number of days specified in the email (e.g., if the email says 4 days, include only Day 1 to Day 4, with Day 4 as the departure day).This thing is important so keep it in mind.\n\nFor each day, include key activities, hotel info, flight times, and transport details \u2014 in simple language\n\nKeep the tone conversational, light, and informative \u2014 like you're helping a friend plan their trip\n\nAvoid using markdown, emojis, special characters, or extra spacing\n\n\"\"\"\"Use this exact structure, do not add any extra words, and match the number of days to the email content and highlights imp things\"\"\"\"\":\n\nHello Traveller,\n\nHere\u2019s your itinerary for your [destination] adventure! Get ready to explore amazing places like [a few highlights based on the email].\n\nDay 1: [Arrival details, flight info, hotel check-in, maybe a light activity or dinner nearby]\nDay 2: [Activities, any planned tours, transport details if moving around]\nDay 3: [Activities, hotel name if changing, any travel between cities]\nDay 4: [Departure day \u2013 include checkout time, transport to airport, and flight info]\n\nBest regards,\nOneclick\n\n\nthis is sample mail \n\nDelhi, the vibrant capital of India! I'd be delighted to help you plan your 4-day trip to Delhi with your family.\n\nHere's a suggested itinerary that covers some of the top attractions, cultural experiences, and culinary delights:\n\n**Day 1: Red Fort, Qutub Minar, and Chandni Chowk**\n\n* Morning: Start at the Red Fort (open from 9:30 AM), a majestic Mughal fort with stunning architecture. Explore the fort's imposing walls, gardens, and palaces.\n* Afternoon: Visit Qutub Minar (open from 10:00 AM), the tallest minaret in India, built by Qutb-ud-din Aibak in 1199 AD.\n* Evening: Take a leisurely stroll through Chandni Chowk, one of Delhi's oldest and most vibrant streets, lined with street food stalls, shops, and historic landmarks.\n\n**Day 2: Humayun's Tomb, Lotus Temple, and Indian Museum**\n\n* Morning: Visit Humayun's Tomb (open from 9:30 AM), a beautiful Mughal mausoleum built by Haji Begum in 1573 AD.\n* Afternoon: Explore the Baha'i Temple (Lotus Temple) in Ashok Vihar (open from 10:00 AM), an iconic temple with stunning architecture and peaceful surroundings.\n* Evening: Head to the Indian Museum, a treasure trove of Indian history and culture, located in Central Delhi.\n\n**Day 3: Akshardham Temple, Laxmi Nagar Shopping Mall, and Chilla Village**\n\n* Morning: Visit the Akshardham Temple (open from 9:00 AM), a magnificent temple complex with intricate carvings, stunning architecture, and beautiful gardens.\n* Afternoon: Spend some time shopping at Laxmi Nagar Shopping Mall, one of Delhi's popular shopping destinations.\n* Evening: Head to Chilla Village, a small village located on the outskirts of Delhi, where you can experience rural India and enjoy a peaceful evening.\n\n**Day 4: Gandhi Smriti, India Gate, and Hauz Khas Village**\n\n* Morning: Visit Gandhi Smriti (open from 9:30 AM), the museum dedicated to Mahatma Gandhi's life and legacy.\n* Afternoon: Explore India Gate (open from 10:00 AM), a stunning war memorial built in honor of Indian soldiers who fought in World War I.\n* Evening: Head to Hauz Khas Village, a trendy neighborhood with boutique shops, cafes, and restaurants.\n\n**Additional Tips**\n\n* Be prepared for the crowds and heat during peak summer months (April to June).\n* Wear comfortable shoes, as you'll be doing a lot of walking throughout the day.\n* Try some local street food, like chaat items or kebabs, but ensure they're cooked and served hygienically.\n* Don't forget to bargain when shopping at local markets!\n* Take breaks and stay hydrated throughout the day.\n\n**Getting Around**\n\n* Use an auto-rickshaw, taxi, or ride-hailing apps (like Ola, Uber) to get around Delhi. Be prepared for traffic congestion.\n* The Metro network in Delhi is efficient and convenient, but be aware of peak hours (7:00 AM - 9:00 AM and 4:00 PM - 6:00 PM).\n\n**Budget Breakdown**\n\n* Accommodation: \u20b95,000-\u20b910,000 (approximately $65-$130 USD) for a family of four, depending on the hotel or hostel you choose.\n* Transportation: \u20b91,500-\u20b93,000 (approximately $20-$40 USD) for auto-rickshaws, taxis, and ride-hailing services.\n* Food: \u20b92,000-\u20b94,000 (approximately $25-$50 USD) per day for meals at local restaurants and street food stalls.\n\nThis itinerary provides a good balance of culture, history, and fun activities that are suitable for families. Feel free to adjust it according to your interests and preferences!\n\n**Are there any specific requests or changes you'd like me to make?\n"
}
]
},
"promptType": "define"
},
"typeVersion": 1.6
},
{
"id": "e5e3a173-43dd-41e5-b373-97c457c70025",
"name": "Email Field Setup",
"type": "n8n-nodes-base.set",
"position": [
100,
-120
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "7d428c48-4809-45d8-ba1e-c96d68c02c07",
"name": "from",
"type": "string",
"value": "={{ $('Trigger From Mail (IMAP)').first().json.from }}"
},
{
"id": "63b99545-3d2d-4563-b9d7-078cbc20dbcc",
"name": "subject",
"type": "string",
"value": "=Re: {{ $('Trigger From Mail (IMAP)').first().json.subject }}"
},
{
"id": "11d94d3f-2170-4b54-b5f9-b85bb95ad472",
"name": "text",
"type": "string",
"value": "={{ $json.text }} "
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f42413ba-81fb-4995-ad56-21f469f7da82",
"name": "Sending Email",
"type": "n8n-nodes-base.emailSend",
"position": [
320,
-120
],
"parameters": {
"text": "={{ $json.text }}",
"options": {},
"subject": "={{ $json.subject }}",
"toEmail": "={{ $json.from }}",
"fromEmail": "user@example.com",
"emailFormat": "text"
},
"credentials": {
"smtp": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "9a3324e1-3fe5-4b13-924d-dcb05daf4c8d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1000,
-340
],
"parameters": {
"width": 420,
"height": 220,
"content": "#### Configure Mail Credentials for Trigger Mail Node\nUnder Credentials, choose or create new IMAP credentials.\nUse settings as per below\n\nIMAP Settings Example:\nHost - imap.gmail.com\nPort - 993\nSecure - true\nUser - your-email@gmail.com\nPassword - App password (for Gmail, use App Password)"
},
"typeVersion": 1
},
{
"id": "0e562abb-7c3a-41e2-8a98-7d583dfa2c90",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1000,
-100
],
"parameters": {
"width": 420,
"height": 220,
"content": "#### Configure SMTP Settings for the Send Mail Node.\nYou need to enter SMTP details:\n\nUser - your-email@gmail.com\nPassword - App password (for Gmail, use App Password)\nHost - smtp.gmail.com\nPort - 465\nSSL/TLS - True"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "2742d28b-b293-481a-8ef2-ec0972d34fe5",
"connections": {
"Basic LLM": {
"main": [
[
{
"node": "Email Field Setup",
"type": "main",
"index": 0
}
]
]
},
"Ollama Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Email Field Setup": {
"main": [
[
{
"node": "Sending Email",
"type": "main",
"index": 0
}
]
]
},
"Trigger From Mail (IMAP)": {
"main": [
[
{
"node": "Basic LLM",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
imapollamaApismtp
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
In this guide, we’ll break down how to set up an AI-powered auto-reply system that works while you sleep. Ready to 10X your efficiency? Let’s dive in! AI-driven auto-responses for Email. Instant replies to FAQs, order confirmations, and support queries. 24/7 availability - no…
Source: https://n8n.io/workflows/4917/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n workflow transforms uploaded health details or lab reports received via email into a customized diet plan using AI analysis, then sends the plan back to the user via email, optimizing nutriti
This advanced n8n workflow provides intelligent email automation with AI-generated responses. It combines four core functions: Monitors incoming emails via IMAP (e.g., SOGo) Sends instant Telegram not
The workflow is triggered manually with user input, searches LinkedIn profiles, processes the results using AI, generates connection recommendations, and delivers them via email. It leverages AI to en
Takes your raw, unpolished voice transcripts and transforms them into well-structured LinkedIn posts using AI. Perfect for when you have good ideas but they come out as rambling thoughts.
This n8n workflow automatically creates friendly, personalized travel itineraries based on messages received via email or WhatsApp. When a user says "I want to go to Dubai with friends for 5 days" or