Agent de voyage
Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 18 nœuds.Utilise principalement des nœuds comme Gmail, Agent, HttpRequestTool, ChatTrigger, LmChatGoogleGemini. Utiliser Gemini AI pour créer un itinéraire de voyage et envoyer une confirmation par e-mail
- •Compte Google et informations d'identification Gmail API
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
- •Clé API Google Gemini
Nœuds utilisés (18)
Catégorie
{
"id": "S6Br0u9sWvllb5wd",
"meta": {
"instanceId": "058026fc00ddd0f398afec59419d60070007f9155d42ea1b5598fa1878c9da96",
"templateCredsSetupCompleted": true
},
"name": "Travel Agent",
"tags": [],
"nodes": [
{
"id": "0c3cd83b-6b61-4f86-b85a-348eba8749ac",
"name": "À la réception du message",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-48,
0
],
"webhookId": "d19123dd-fa85-4123-ae5a-86c5552c265d",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "bead5f60-a31f-49d5-a514-34cf1bb90649",
"name": "Extract User Request",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
192,
0
],
"parameters": {
"options": {
"systemMessage": "=ROLE\nYou are an expert information extraction specialist focused on parsing travel requests with precision and intelligence. Your expertise lies in identifying, categorising, and structuring travel-related information from user input whilst applying logical inference to fill gaps where information is implicitly present but not explicitly stated.\n\nTASK\nAnalyse incoming travel requests to systematically identify and extract all relevant travel parameters, apply expert knowledge to infer missing but essential information based on context and travel norms, categorise extracted data appropriately, and format the complete information set according to the specified Output Parser requirements whilst maintaining clear distinction between explicit and inferred data.\n\nINPUT\nRaw travel requests containing varying levels of detail about destinations, dates, budgets, traveller preferences, accommodation needs, and trip requirements. Input may be incomplete, ambiguous, or require contextual interpretation to extract meaningful travel parameters.\n\nOUTPUT\nStructured data extraction formatted according to the specified Output Parser requirements defined below. Output must clearly distinguish between explicitly stated information and intelligent assumptions, presenting all extracted travel parameters in the required format with appropriate categorisation and completeness indicators.\n\n{\n \"type\": \"object\",\n \"properties\": {\n \"origin\": {\n \"type\": \"string\",\n \"description\": \"The origin city/location\"\n },\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"The destination city/location\"\n },\n \"departure\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"The departure date (YYYY-MM-DD)\"\n },\n \"return\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"The return date (YYYY-MM-DD)\"\n },\n \"duration\": {\n \"type\": \"integer\",\n \"description\": \"Trip duration in days (if specified instead of return date)\"\n },\n \"travelers\": {\n \"type\": \"object\",\n \"properties\": {\n \"adults\": {\n \"type\": \"integer\",\n \"default\": 1,\n \"description\": \"Number of adults\"\n },\n \"children\": {\n \"type\": \"integer\",\n \"default\": 0,\n \"description\": \"Number of children\"\n },\n \"infants\": {\n \"type\": \"integer\",\n \"default\": 0,\n \"description\": \"Number of infants\"\n }\n }\n },\n \"tripType\": {\n \"type\": \"string\",\n \"enum\": [\n \"business\",\n \"leisure\",\n \"family\",\n \"romantic\",\n \"adventure\",\n \"cultural\",\n \"holiday\",\n \"weekend\",\n \"other\"\n ],\n \"description\": \"Type of trip mentioned\"\n },\n \"budget\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\n \"type\": \"number\",\n \"description\": \"Budget amount if mentioned\"\n },\n \"currency\": {\n \"type\": \"string\",\n \"description\": \"Currency (USD, EUR, GBP, etc.)\"\n },\n \"budgetLevel\": {\n \"type\": \"string\",\n \"enum\": [\n \"budget\",\n \"mid-range\",\n \"luxury\",\n \"ultra-luxury\"\n ],\n \"description\": \"Budget level if specific amount not given\"\n }\n }\n },\n \"preferences\": {\n \"type\": \"object\",\n \"properties\": {\n \"accommodation\": {\n \"type\": \"string\",\n \"enum\": [\n \"hotel\",\n \"resort\",\n \"hostel\",\n \"airbnb\",\n \"boutique\",\n \"luxury\"\n ],\n \"description\": \"Preferred accommodation type\"\n },\n \"transportation\": {\n \"type\": \"string\",\n \"enum\": [\n \"flight\",\n \"train\",\n \"car\",\n \"bus\",\n \"ferry\"\n ],\n \"description\": \"Preferred transportation method\"\n },\n \"activities\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"sightseeing\",\n \"museums\",\n \"nightlife\",\n \"shopping\",\n \"restaurants\",\n \"beaches\",\n \"nature\",\n \"adventure\",\n \"relaxation\",\n \"culture\",\n \"history\",\n \"sports\"\n ]\n },\n \"description\": \"Mentioned activity preferences\"\n },\n \"foodPreferences\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Dietary restrictions or food preferences mentioned\"\n }\n }\n },\n \"occasions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"honeymoon\",\n \"anniversary\",\n \"birthday\",\n \"graduation\",\n \"retirement\",\n \"business\",\n \"conference\",\n \"holiday\",\n \"vacation\"\n ]\n },\n \"description\": \"Special occasions mentioned\"\n },\n \"flexibility\": {\n \"type\": \"object\",\n \"properties\": {\n \"dates\": {\n \"type\": \"boolean\",\n \"description\": \"Whether dates are flexible\"\n },\n \"destination\": {\n \"type\": \"boolean\",\n \"description\": \"Whether destination is flexible\"\n },\n \"budget\": {\n \"type\": \"boolean\",\n \"description\": \"Whether budget is flexible\"\n }\n }\n },\n \"urgency\": {\n \"type\": \"string\",\n \"enum\": [\n \"immediate\",\n \"soon\",\n \"flexible\",\n \"planning_ahead\"\n ],\n \"description\": \"How urgent the booking is\"\n },\n \"groupType\": {\n \"type\": \"string\",\n \"enum\": [\n \"solo\",\n \"couple\",\n \"family\",\n \"friends\",\n \"business_group\",\n \"large_group\"\n ],\n \"description\": \"Type of travel group\"\n }\n },\n \"required\": [\n \"destination\"\n ]\n}\n\nCAPABILITIES & REMINDERS\nInformation Extraction Expertise:\n** Systematic parsing of unstructured travel requests for key parameters.\n** Pattern recognition for implicit travel requirements and preferences.\n** Contextual inference based on destination characteristics and travel norms.\n** Data standardisation across varying input formats and terminology.\n** Quality validation of extracted information for completeness and accuracy.\nInference Guidelines:\n** Apply reasonable assumptions only when gaps exist in critical travel parameters.\n** Base inferences on destination-specific norms, seasonal considerations, and typical traveller behaviour.\n** Maintain conservative approach to assumptions, avoiding over-interpretation.\n** Clearly mark all inferred information as assumptions rather than confirmed requirements.\n** Ensure inferences align with explicitly stated preferences and constraints.\nData Quality Assurance:\n** Cross-validation of extracted parameters for internal consistency.\n** Verification that all inferences are logical and contextually appropriate.\n** Confirmation that output format meets parser specifications exactly.\n** Ensuring no critical travel information is overlooked or misinterpreted.\n\nCurrent System Time is {{ $now }}.\n\nCONSTRAINTS\n** Extract only information that is explicitly stated or can be reasonably inferred from context.\n** Apply logical assumptions based on standard travel patterns and destination norms only when information gaps exist.\n** Clearly differentiate between confirmed user-provided data and inferred parameters.\n** Maintain consistency in data interpretation and categorisation.\n** Ensure all extracted information aligns with realistic travel scenarios.\n** Structure output strictly according to Output Parser specifications.\n** Preserve original user intent whilst standardising format and terminology."
},
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "4c8b77cc-35ec-4812-bba0-a52ba36b70e4",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
368,
208
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"origin\": {\n \"type\": \"string\",\n \"description\": \"The origin city/location\"\n },\n \"destination\": {\n \"type\": \"string\", \n \"description\": \"The destination city/location\"\n },\n \"departure\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"The departure date (YYYY-MM-DD)\"\n },\n \"return\": {\n \"type\": \"string\",\n \"format\": \"date\", \n \"description\": \"The return date (YYYY-MM-DD)\"\n },\n \"duration\": {\n \"type\": \"integer\",\n \"description\": \"Trip duration in days (if specified instead of return date)\"\n },\n \"travelers\": {\n \"type\": \"object\",\n \"properties\": {\n \"adults\": {\n \"type\": \"integer\",\n \"default\": 1,\n \"description\": \"Number of adults\"\n },\n \"children\": {\n \"type\": \"integer\",\n \"default\": 0,\n \"description\": \"Number of children\"\n },\n \"infants\": {\n \"type\": \"integer\", \n \"default\": 0,\n \"description\": \"Number of infants\"\n }\n }\n },\n \"tripType\": {\n \"type\": \"string\",\n \"enum\": [\"business\", \"leisure\", \"family\", \"romantic\", \"adventure\", \"cultural\", \"holiday\", \"weekend\", \"other\"],\n \"description\": \"Type of trip mentioned\"\n },\n \"budget\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\n \"type\": \"number\",\n \"description\": \"Budget amount if mentioned\"\n },\n \"currency\": {\n \"type\": \"string\",\n \"description\": \"Currency (USD, EUR, GBP, etc.)\"\n },\n \"budgetLevel\": {\n \"type\": \"string\",\n \"enum\": [\"budget\", \"mid-range\", \"luxury\", \"ultra-luxury\"],\n \"description\": \"Budget level if specific amount not given\"\n }\n }\n },\n \"preferences\": {\n \"type\": \"object\", \n \"properties\": {\n \"accommodation\": {\n \"type\": \"string\",\n \"enum\": [\"hotel\", \"resort\", \"hostel\", \"airbnb\", \"boutique\", \"luxury\"],\n \"description\": \"Preferred accommodation type\"\n },\n \"transportation\": {\n \"type\": \"string\",\n \"enum\": [\"flight\", \"train\", \"car\", \"bus\", \"ferry\"],\n \"description\": \"Preferred transportation method\"\n },\n \"activities\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"sightseeing\", \"museums\", \"nightlife\", \"shopping\", \"restaurants\", \"beaches\", \"nature\", \"adventure\", \"relaxation\", \"culture\", \"history\", \"sports\"]\n },\n \"description\": \"Mentioned activity preferences\"\n },\n \"foodPreferences\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Dietary restrictions or food preferences mentioned\"\n }\n }\n },\n \"occasions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"honeymoon\", \"anniversary\", \"birthday\", \"graduation\", \"retirement\", \"business\", \"conference\", \"holiday\", \"vacation\"]\n },\n \"description\": \"Special occasions mentioned\"\n },\n \"flexibility\": {\n \"type\": \"object\",\n \"properties\": {\n \"dates\": {\n \"type\": \"boolean\",\n \"description\": \"Whether dates are flexible\"\n },\n \"destination\": {\n \"type\": \"boolean\", \n \"description\": \"Whether destination is flexible\"\n },\n \"budget\": {\n \"type\": \"boolean\",\n \"description\": \"Whether budget is flexible\"\n }\n }\n },\n \"urgency\": {\n \"type\": \"string\",\n \"enum\": [\"immediate\", \"soon\", \"flexible\", \"planning_ahead\"],\n \"description\": \"How urgent the booking is\"\n },\n \"groupType\": {\n \"type\": \"string\",\n \"enum\": [\"solo\", \"couple\", \"family\", \"friends\", \"business_group\", \"large_group\"],\n \"description\": \"Type of travel group\"\n }\n },\n \"required\": [\"destination\"]\n}"
},
"typeVersion": 1.3
},
{
"id": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"name": "Planner Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
816,
0
],
"parameters": {
"text": "=The requested travel information is as follows (in JSON format):\n{{ JSON.stringify($json.output) }}",
"options": {
"systemMessage": "=ROLE\nYou are an expert travel planning specialist with comprehensive knowledge of global destinations, flight routing, accommodation standards, and activity curation. Your expertise encompasses intelligent travel logistics coordination, preference interpretation, and comprehensive itinerary development using specialised search tools to deliver personalised travel recommendations that balance user preferences with practical feasibility.\n\nTASK\nProcess incoming JSON travel requests to extract planning parameters, execute systematic searches using the three designated tools based on user preferences and expert assumptions, curate optimal recommendations within specified limits for each category, and compile comprehensive travel plans in the required JSON format whilst ensuring all suggestions are practical and preference-aligned with complete detail structures including visual content.\n\nINPUT\nThe user's request contains travel parameters including destinations, dates, budgets, traveller demographics, and preference specifications for flights, activities, and accommodations (as a JSON object). Input may contain incomplete preference data requiring expert interpretation and assumption-making based on destination characteristics and standard travel patterns.\n\nOUTPUT\nComprehensive JSON-formatted travel plans containing curated recommendations across three core categories: flights (maximum 3 options), activities (maximum 5 suggestions), and accommodations (multiple options), accompanied by a detailed summary of the original user request. All recommendations must be sourced through designated search tools and formatted according to the specified JSON structure with complete detail sets including image URLs when available.\n\nCAPABILITIES & REMINDERS\nAvailable Planning Tools:\n** Flights: Search and recommend up to 3 flight options based on route, dates, and budget parameters, capturing airline logos or aircraft images when available.\n** Activities: Discover and suggest up to 5 relevant activities prioritising \"preferences.activities\" when available, defaulting to destination highlights when preferences are unspecified, including activity/attraction images when provided.\n** Accommodations: Source accommodation options via Google Maps integration, filtering by \"preferences.accommodations\" type or defaulting to hotel searches when unspecified, capturing property images when available.\n** Accommodation Details: Obtain the details of an accommodation using the \"property_token\". This information is then used to update the output accordingly.\nExpert Guidelines:\n** Apply destination-specific knowledge to fill gaps in user preferences intelligently.\n** Consider seasonal factors, cultural norms, and typical traveller behaviour patterns.\n** Maintain consistency between traveller demographics and recommended options.\n** Balance user preferences with practical availability and booking considerations.\n** Ensure assumptions align with budget parameters and travel dates.\n** Prioritise recommendations with visual content when available from tools.\n\nJSON Output Structure:\n{\n \"flights\": [\n {\n \"flight_number\": \"string\",\n \"airline\": \"string\",\n \"departure_airport\": \"string\",\n \"arrival_airport\": \"string\",\n \"departure_time\": \"string\",\n \"arrival_time\": \"string\",\n \"duration\": \"string\",\n \"stops\": \"string\",\n \"price\": \"string\",\n \"booking_class\": \"string\",\n \"aircraft_type\": \"string\",\n \"image_url\": \"string\"\n }\n ],\n \"activities\": [\n {\n \"name\": \"string\",\n \"description\": \"string\",\n \"location\": \"string\",\n \"address\": \"string\",\n \"duration\": \"string\",\n \"price\": \"string\",\n \"category\": \"string\",\n \"rating\": \"string\",\n \"booking_required\": \"boolean\",\n \"opening_hours\": \"string\",\n \"best_time_to_visit\": \"string\",\n \"image_url\": \"string\"\n }\n ],\n \"accommodations\": [\n {\n \"name\": \"string\",\n \"address\": \"string\",\n \"location_description\": \"string\",\n \"accommodation_type\": \"string\",\n \"room_type\": \"string\",\n \"price_per_night\": \"string\",\n \"total_price\": \"string\",\n \"check_in_date\": \"string\",\n \"check_out_date\": \"string\",\n \"amenities\": [\n \"array of strings\"\n ],\n \"rating\": \"string\",\n \"review_count\": \"string\",\n \"cancellation_policy\": \"string\",\n \"distance_to_city_centre\": \"string\",\n \"image_url\": \"string\",\n \"website_url\": \"string\"\n }\n ],\n \"request_info\": \"Comprehensive summary of the original user request including preferences and planning parameters. Write in third person.\"\n}\n\nSearch Strategy:\n** Flights: Prioritise route efficiency, timing preferences, and budget alignment whilst capturing complete flight details including layovers, aircraft types, booking classes, and airline/aircraft imagery when available.\n** Activities: Focus on \"preferences.activities\" first, supplement with destination highlights when needed, ensuring complete activity information including practical details for booking and visiting, plus visual content when provided by tools.\n** Accommodations: Filter by specified accommodation type in \"preferences.accommodations\", default to hotels when empty, providing comprehensive property details including amenities, policies, location context, and property images when available.\n** Cross-reference all recommendations for geographical proximity and logical itinerary flow. When the results are returned successfully by this tool, you need to obtain the \"property_token\" from each item and call the \"Accommodation Details\" to obtain the website of the place.\nQuality Standards:\n** Ensure all tool-generated recommendations meet user specifications and budget parameters with complete data structures.\n** Verify geographical and logistical feasibility of all suggestions.\n** Maintain consistency across flight times, accommodation locations, and activity scheduling.\n** Provide comprehensive \"request_info\" summary capturing all key planning elements and assumptions made.\n** Include all specified fields in each recommendation object, using \"Not available\" for image URLs when not provided by tools, or appropriate default values for other missing information.\n** Ensure price information is clearly formatted with currency and time period specifications.\n** Validate that all timing information (flights, check-ins, activity hours) aligns with travel dates and local time zones.\n** Prioritise recommendations with accompanying images to enhance user experience when available from search tools.\n\nCurrent System Time is {{ $now }}.\n\nCONSTRAINTS\n** Utilise only the three designated planning tools: Flights, Activities, and Accommodations.\n** Limit flight suggestions to maximum 3 options per request.\n** Restrict activity recommendations to maximum 5 suggestions per request.\n** Base activity planning primarily on \"preferences.activities\" when provided; default to destination's most popular attractions when preferences are empty or absent.\n** Interpret \"preferences.accommodations\" to determine accommodation type; assume \"hotel\" when unspecified or empty.\n** Apply expert assumptions for missing information based on destination norms and traveller profiles.\n** Structure all output in the exact JSON format specified with complete data structures.\n** Include image URLs when returned by search tools; use \"Not available\" when images are not provided.\n** Ensure all recommendations are practical, bookable, and align with stated or inferred preferences."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "d30bccb8-2ac3-448a-b76e-73ea2229eaee",
"name": "Accommodations",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1120,
400
],
"parameters": {
"url": "https://serpapi.com/search",
"options": {},
"sendBody": true,
"sendQuery": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "engine",
"value": "google_hotels"
},
{
"name": "check_in_date",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters1_Value', ``, 'string') }}"
},
{
"name": "check_out_date",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters2_Value', ``, 'string') }}"
},
{
"name": "adults",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters3_Value', `Number of adult travellers. Must be greater or equal 1.`, 'string') }}"
},
{
"name": "sort_by",
"value": "8"
}
]
},
"genericAuthType": "httpQueryAuth",
"queryParameters": {
"parameters": [
{
"name": "q",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
}
]
},
"toolDescription": "Makes an HTTP request and returns the response data for hotels search."
},
"credentials": {
"httpQueryAuth": {
"id": "TdN4YoVhyMqw2qub",
"name": "Query Auth account 2"
}
},
"typeVersion": 4.2
},
{
"id": "cafd5497-3f6c-448c-ab80-154bdb99f568",
"name": "Accommodation Details",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
960,
400
],
"parameters": {
"url": "https://serpapi.com/search",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"queryParameters": {
"parameters": [
{
"name": "q",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', `The q value should be the same as the one used in the \"Accommodations\" tool.`, 'string') }}"
},
{
"name": "property_token",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters1_Value', `The property_token value can be obtained from each item returned by the \"Accommodations\" tool.`, 'string') }}"
}
]
},
"toolDescription": "Makes an HTTP request and returns the response data for hotel details."
},
"credentials": {
"httpQueryAuth": {
"id": "TdN4YoVhyMqw2qub",
"name": "Query Auth account 2"
}
},
"typeVersion": 4.2
},
{
"id": "e5e30a1d-9b47-4d47-a681-0edd7db9f54e",
"name": "E-mail Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1472,
0
],
"parameters": {
"text": "=The travel plan is as follows (in JSON format):\n{{ JSON.stringify($json.output) }}",
"options": {
"systemMessage": "=ROLE\nYou are an expert email marketing specialist and travel communication designer with expertise in creating visually appealing, responsive HTML emails that effectively present travel information in an engaging, user-friendly format. Your skills encompass modern email design principles, responsive layouts, and clear information hierarchy to enhance the travel planning experience.\n\nTASK\nTransform the structured travel plan JSON into a compelling, professionally designed HTML email that presents all travel recommendations in an organised, visually appealing format, creates an engaging subject line that captures the essence of the travel plan, and ensures the email is fully responsive and compatible across email platforms whilst maintaining excellent user experience.\n\nINPUT\nComplete travel plan JSON containing curated flight recommendations, activity suggestions, accommodation options, and request summary from the travel planning agent. Input includes structured data with all travel details, pricing, timing, and visual content that needs to be transformed into an engaging email format.\n\nOUTPUT\nProfessional JSON response containing a compelling email subject line and fully responsive HTML email content that presents the travel plan in an organised, visually appealing format optimised for both desktop and mobile viewing. Email must include all travel recommendations with clear formatting, pricing, and booking information. Then, you will write a summary of the email content.\n\nCAPABILITIES & REMINDERS\nEmail Design Standards:\n** Responsive HTML structure using table-based layouts for email client compatibility.\n** Inline CSS styling with media queries for mobile responsiveness.\n** Professional typography with web-safe fonts and appropriate sizing.\n** Consistent colour scheme and branding elements throughout the email.\n** Clear section divisions for flights, activities, and accommodations.\nContent Organisation:\n** Compelling email subject line that reflects destination and travel dates.\n** Personalised greeting and introduction referencing the original request.\n** Structured presentation of flight options with key details and pricing.\n** Organised activity recommendations with descriptions, timing, and costs.\n** Clear accommodation listings with amenities, pricing, and location details.\n** Professional closing with next steps and booking guidance.\nTechnical Requirements:\n** Maximum email width of 600px for optimal desktop viewing.\n** Mobile-responsive breakpoints at 480px and below.\n** Table-based layouts for consistent rendering across email clients.\n** Inline CSS with !important declarations for style priority.\n** Alt text for all images and proper semantic structure.\n** Cross-platform tested colour codes and font specifications.\n\nJSON Output Structure:\n{\n\"subject\": \"Personalised email subject line incorporating destination and travel dates\",\n\"content\": \"Complete responsive HTML email content with inline CSS styling, structured presentation of all travel recommendations, and professional formatting\",\n\"summary\": \"Summary of the email content\"\n}\n\nQuality Standards:\n** Subject line must be engaging, specific to the travel plan, and under 50 characters when possible.\n** HTML content must be fully responsive and render consistently across email platforms.\n** All travel information from input JSON must be included and clearly presented.\n** Visual hierarchy must guide readers through flight, activity, and accommodation sections logically.\n** Professional tone with clear calls-to-action for booking and further planning.\n** Include pricing summaries and practical booking information.\n** Ensure accessibility compliance with proper contrast and semantic structure.\n\nCONSTRAINTS\n** Generate responsive HTML email compatible with major email clients (Gmail, Outlook, Apple Mail, etc.).\n** Use inline CSS styling for maximum compatibility across email platforms.\n** Structure content with clear visual hierarchy using headers, sections, and spacing.\n** Include all flight, activity, and accommodation details from the input JSON.\n** Present pricing information clearly with currency formatting.\n** Ensure mobile-responsive design with appropriate font sizes and touch-friendly elements.\n** Use professional colour scheme and typography suitable for travel communications.\n** Include call-to-action elements for booking and further information.\n** Maintain accessibility standards with proper alt text and contrast ratios.\n** Must not include any link elements that have an empty value, a value of \"#\", or a url starting with only \"http\"."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "61002fec-fa56-48b2-8131-6e8b4db888ee",
"name": "Structured Output Parser1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1648,
208
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"title\": \"Email Output Schema\",\n \"description\": \"JSON schema for travel email output containing subject line and responsive HTML content\",\n \"required\": [\"subject\", \"content\"],\n \"properties\": {\n \"subject\": {\n \"type\": \"string\",\n \"description\": \"Engaging email subject line incorporating destination and travel dates, optimally under 50 characters\",\n \"maxLength\": 100\n },\n \"content\": {\n \"type\": \"string\",\n \"description\": \"Complete responsive HTML email content with inline CSS styling, presenting all travel plan details in a professional, user-friendly format optimised for email clients\"\n },\n \"summary\": {\n \"type\": \"string\",\n \"description\": \"Summary of the email content\"\n }\n }\n}"
},
"typeVersion": 1.3
},
{
"id": "366658d3-7a45-40f3-91ac-d7ebf62c28ee",
"name": "Structured Output Parser2",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1280,
400
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{ \n \"type\": \"object\",\n \"title\": \"Travel Plan Output Schema\",\n \"description\": \"JSON schema for travel planning output containing flights, activities, accommodations, weather forecasts, and request summary with image support\",\n \"required\": [\"flights\", \"activities\", \"accommodations\", \"weather\", \"request_info\"],\n \"properties\": {\n \"flights\": {\n \"type\": \"array\",\n \"maxItems\": 3,\n \"description\": \"Array of flight recommendations (maximum 3)\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"flight_number\", \"airline\", \"departure_airport\", \"arrival_airport\", \"departure_time\", \"arrival_time\", \"duration\", \"stops\", \"price\", \"booking_class\", \"aircraft_type\", \"image_url\"],\n \"properties\": {\n \"flight_number\": { \"type\": \"string\", \"description\": \"Flight number identifier\" },\n \"airline\": { \"type\": \"string\", \"description\": \"Airline name\" },\n \"departure_airport\": { \"type\": \"string\", \"description\": \"Departure airport code or name\" },\n \"arrival_airport\": { \"type\": \"string\", \"description\": \"Arrival airport code or name\" },\n \"departure_time\": { \"type\": \"string\", \"description\": \"Departure time with date and timezone\" },\n \"arrival_time\": { \"type\": \"string\", \"description\": \"Arrival time with date and timezone\" },\n \"duration\": { \"type\": \"string\", \"description\": \"Total flight duration\" },\n \"stops\": { \"type\": \"string\", \"description\": \"Number and location of stops or 'Direct'\" },\n \"price\": { \"type\": \"string\", \"description\": \"Flight price with currency\" },\n \"booking_class\": { \"type\": \"string\", \"description\": \"Booking class (Economy, Business, First, etc.)\" },\n \"aircraft_type\": { \"type\": \"string\", \"description\": \"Aircraft model and type\" },\n \"image_url\": { \"type\": \"string\", \"description\": \"URL to airline logo or aircraft image, 'Not available' if not provided\" }\n }\n }\n },\n \"activities\": {\n \"type\": \"array\",\n \"maxItems\": 5,\n \"description\": \"Array of activity recommendations (maximum 5)\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\", \"description\", \"location\", \"address\", \"duration\", \"price\", \"category\", \"rating\", \"booking_required\", \"opening_hours\", \"best_time_to_visit\", \"image_url\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"description\": \"Activity name or title\" },\n \"description\": { \"type\": \"string\", \"description\": \"Detailed activity description\" },\n \"location\": { \"type\": \"string\", \"description\": \"General location or area\" },\n \"address\": { \"type\": \"string\", \"description\": \"Specific address\" },\n \"duration\": { \"type\": \"string\", \"description\": \"Estimated duration for the activity\" },\n \"price\": { \"type\": \"string\", \"description\": \"Activity cost with currency or 'Free'\" },\n \"category\": { \"type\": \"string\", \"description\": \"Activity category (cultural, adventure, dining, etc.)\" },\n \"rating\": { \"type\": \"string\", \"description\": \"Rating score out of 5 or review platform rating\" },\n \"booking_required\": { \"type\": \"boolean\", \"description\": \"Whether advance booking is required\" },\n \"opening_hours\": { \"type\": \"string\", \"description\": \"Operating hours or schedule\" },\n \"best_time_to_visit\": { \"type\": \"string\", \"description\": \"Recommended time of day or season to visit\" },\n \"image_url\": { \"type\": \"string\", \"description\": \"URL to activity or attraction image, 'Not available' if not provided\" }\n }\n }\n },\n \"accommodations\": {\n \"type\": \"array\",\n \"description\": \"Array of accommodation recommendations\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\", \"address\", \"location_description\", \"accommodation_type\", \"room_type\", \"price_per_night\", \"total_price\", \"check_in_date\", \"check_out_date\", \"amenities\", \"rating\", \"review_count\", \"cancellation_policy\", \"distance_to_city_centre\", \"image_url\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"description\": \"Property name\" },\n \"address\": { \"type\": \"string\", \"description\": \"Full property address\" },\n \"location_description\": { \"type\": \"string\", \"description\": \"Neighbourhood or area description\" },\n \"accommodation_type\": { \"type\": \"string\", \"description\": \"Type of accommodation (hotel, hostel, apartment, etc.)\" },\n \"room_type\": { \"type\": \"string\", \"description\": \"Room category or type\" },\n \"price_per_night\": { \"type\": \"string\", \"description\": \"Nightly rate with currency\" },\n \"total_price\": { \"type\": \"string\", \"description\": \"Total cost for entire stay with currency\" },\n \"check_in_date\": { \"type\": \"string\", \"description\": \"Check-in date\" },\n \"check_out_date\": { \"type\": \"string\", \"description\": \"Check-out date\" },\n \"amenities\": { \"type\": \"array\", \"description\": \"List of property amenities\", \"items\": { \"type\": \"string\" } },\n \"rating\": { \"type\": \"string\", \"description\": \"Property rating score\" },\n \"review_count\": { \"type\": \"string\", \"description\": \"Number of reviews\" },\n \"cancellation_policy\": { \"type\": \"string\", \"description\": \"Cancellation terms and conditions\" },\n \"distance_to_city_centre\": { \"type\": \"string\", \"description\": \"Distance from city centre with travel time\" },\n \"image_url\": { \"type\": \"string\", \"description\": \"URL to property image, 'Not available' if not provided\" },\n \"website_url\": { \"type\": \"string\", \"description\": \"URL to property website, 'Not available' if not provided\" }\n }\n }\n },\n \"weather\": {\n \"type\": \"array\",\n \"description\": \"Weather forecast details for travel destination(s)\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"date\", \"location\", \"temperature_high\", \"temperature_low\", \"condition\", \"precipitation_chance\", \"humidity\", \"wind_speed\", \"uv_index\", \"image_url\"],\n \"properties\": {\n \"date\": { \"type\": \"string\", \"description\": \"Forecast date with timezone\" },\n \"location\": { \"type\": \"string\", \"description\": \"City or destination location\" },\n \"temperature_high\": { \"type\": \"string\", \"description\": \"Maximum expected temperature with unit\" },\n \"temperature_low\": { \"type\": \"string\", \"description\": \"Minimum expected temperature with unit\" },\n \"condition\": { \"type\": \"string\", \"description\": \"General weather condition (Sunny, Cloudy, Rainy, etc.)\" },\n \"precipitation_chance\": { \"type\": \"string\", \"description\": \"Chance of rain/snow with percentage\" },\n \"humidity\": { \"type\": \"string\", \"description\": \"Humidity level in percentage\" },\n \"wind_speed\": { \"type\": \"string\", \"description\": \"Wind speed with unit\" },\n \"uv_index\": { \"type\": \"string\", \"description\": \"UV index level\" },\n \"image_url\": { \"type\": \"string\", \"description\": \"URL to weather icon or illustration, 'Not available' if not provided\" }\n }\n }\n },\n \"request_info\": {\n \"type\": \"string\",\n \"description\": \"Comprehensive summary of the original user request including preferences and planning parameters written in third person\"\n }\n }\n}\n"
},
"typeVersion": 1.3
},
{
"id": "369efec7-b15d-4fd3-b364-3871634e8e1d",
"name": "Send a message",
"type": "n8n-nodes-base.gmail",
"position": [
1808,
0
],
"webhookId": "e06cbad4-9882-4c74-bd64-8d15f28eb54d",
"parameters": {
"sendTo": "dangkhoa.dk19@gmail.com",
"message": "={{ $json.output.content }}",
"options": {},
"subject": "={{ $json.output.subject }}"
},
"credentials": {
"gmailOAuth2": {
"id": "f2AXAChfee6nsCv9",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "a3273df5-31c3-47a6-a2dd-61f1d5f44f8c",
"name": "Modèle de chat Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
160,
208
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "VnJ2ITvhhXCweHhj",
"name": "Google Gemini(PaLM) Api account 2"
}
},
"typeVersion": 1
},
{
"id": "0ea1c17e-f08d-4825-9e46-ef5a87cab8dd",
"name": "Modèle de chat Google Gemini1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
640,
160
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "VnJ2ITvhhXCweHhj",
"name": "Google Gemini(PaLM) Api account 2"
}
},
"typeVersion": 1
},
{
"id": "65086e7c-c8b5-46ad-a4f0-7c5eb26ba8c5",
"name": "Modèle de chat Google Gemini2",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
1456,
208
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "VnJ2ITvhhXCweHhj",
"name": "Google Gemini(PaLM) Api account 2"
}
},
"typeVersion": 1
},
{
"id": "692a23b0-790c-47ef-9709-e3bc6db5c240",
"name": "Activities",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
656,
400
],
"parameters": {
"url": "https://serpapi.com/search",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"queryParameters": {
"parameters": [
{
"name": "q",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
}
]
},
"toolDescription": "Makes an HTTP request and returns the response data for activities search."
},
"credentials": {
"httpQueryAuth": {
"id": "TdN4YoVhyMqw2qub",
"name": "Query Auth account 2"
}
},
"typeVersion": 4.2
},
{
"id": "e0169aef-8269-4e10-8653-d2f80370d37e",
"name": "Flight booking",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
800,
400
],
"parameters": {
"url": "https://serpapi.com/search?engine=google_flights",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"queryParameters": {
"parameters": [
{
"name": "departure_id",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
},
{
"name": "arrival_id",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters1_Value', ``, 'string') }}"
}
]
},
"toolDescription": "Makes an HTTP request and returns the response data for flights search."
},
"credentials": {
"httpQueryAuth": {
"id": "TdN4YoVhyMqw2qub",
"name": "Query Auth account 2"
}
},
"typeVersion": 4.2
},
{
"id": "562b5477-b417-4f8f-ae31-5fed0d3d9ec2",
"name": "Note adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
112,
-256
],
"parameters": {
"width": 432,
"height": 608,
"content": "## Extract User Request \nWhen chat message received: This is the trigger that starts the workflow whenever a new message is received from a user.\n\nExtract User Request: This node uses a Google Gemini Chat Model and a Structured Output Parser to analyze the user's message. Its purpose is to identify the user's intent and extract key information like the destination, travel dates, or specific requests. "
},
"typeVersion": 1
},
{
"id": "adb944de-192b-45b3-aef9-6fcd6700a4d1",
"name": "Note adhésive1",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
-256
],
"parameters": {
"color": 3,
"width": 832,
"height": 816,
"content": "## Planner Agent\nPlanner Agent: This central node acts as a multi-step planner. It takes the parsed request from the first block and uses a Google Gemini Chat Model to orchestrate the travel planning process.\n\nSub-nodes (Activities, Flight booking, Accommodation Details, Accommodations): The Planner Agent calls these sub-nodes, which are configured to make specific API calls (indicated by GET: https://usersapi.co/GET...) to gather real-time data on activities, flights, and accommodations.\n\nStructured Output Parser 2: This parser node likely combines the data from all the sub-nodes into a single, structured output that can be easily used by the next part of the workflow."
},
"typeVersion": 1
},
{
"id": "dc78acff-3605-462a-a60b-20de148acbf9",
"name": "Note adhésive2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1408,
-256
],
"parameters": {
"width": 368,
"height": 608,
"content": "## Email Agent\nEmail Agent: This node is responsible for generating the final email. It takes the comprehensive travel plan from the Planner Agent and uses a second Google Gemini Chat Model to format it into a coherent, well-written email.\n\nStructured Output Parser 1: This parser ensures the final email content is in a clean format, ready to be sent.\n\n"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "44635539-e2c5-4d32-ac96-b679f6a2e492",
"connections": {
"692a23b0-790c-47ef-9709-e3bc6db5c240": {
"ai_tool": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Agent": {
"main": [
[
{
"node": "369efec7-b15d-4fd3-b364-3871634e8e1d",
"type": "main",
"index": 0
}
]
]
},
"a99a8df1-5b3e-44e1-aeb5-a43944f01c92": {
"main": [
[
{
"node": "Email Agent",
"type": "main",
"index": 0
}
]
]
},
"d30bccb8-2ac3-448a-b76e-73ea2229eaee": {
"ai_tool": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "ai_tool",
"index": 0
}
]
]
},
"e0169aef-8269-4e10-8653-d2f80370d37e": {
"ai_tool": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "ai_tool",
"index": 0
}
]
]
},
"369efec7-b15d-4fd3-b364-3871634e8e1d": {
"main": [
[]
]
},
"bead5f60-a31f-49d5-a514-34cf1bb90649": {
"main": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "main",
"index": 0
}
]
]
},
"cafd5497-3f6c-448c-ab80-154bdb99f568": {
"ai_tool": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "bead5f60-a31f-49d5-a514-34cf1bb90649",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"4c8b77cc-35ec-4812-bba0-a52ba36b70e4": {
"ai_outputParser": [
[
{
"node": "bead5f60-a31f-49d5-a514-34cf1bb90649",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Google Gemini Chat Model1": {
"ai_languageModel": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Gemini Chat Model2": {
"ai_languageModel": [
[
{
"node": "Email Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"61002fec-fa56-48b2-8131-6e8b4db888ee": {
"ai_outputParser": [
[
{
"node": "Email Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"366658d3-7a45-40f3-91ac-d7ebf62c28ee": {
"ai_outputParser": [
[
{
"node": "a99a8df1-5b3e-44e1-aeb5-a43944f01c92",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "bead5f60-a31f-49d5-a514-34cf1bb90649",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - Création de contenu, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Paul Abraham
@hellopaulSoftware Engineer & Automation Consultant with over 3+ years in experience helping teams streamline workflows with n8n, APIs, and AI-driven solutions.
Partager ce workflow