8
n8n 中文网amn8n.com

自动旅行行程规划器:邮件和WhatsApp旅行助手

中级

这是一个Support Chatbot, AI Chatbot领域的自动化工作流,包含 9 个节点。主要使用 If, Set, WhatsApp, EmailSend, EmailReadImap 等节点。 通过邮件和WhatsApp使用Llama AI生成个性化旅行行程

前置要求
  • 无特殊前置要求,导入即可使用
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "GlbemCHcAaeKcxhC",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "自动旅行行程规划器:邮件和 WhatsApp 旅行助手",
  "tags": [],
  "nodes": [
    {
      "id": "9b84fba6-d666-4b88-8e28-bcbd8bf633a0",
      "name": "行程创建代理",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -380,
        -200
      ],
      "parameters": {
        "text": "={{ $json.textPlain }}",
        "messages": {
          "messageValues": [
            {
              "message": "=Instruction:\n\nYou are a helpful travel planning assistant. Based on the user's message, create a personalized, human-style travel itinerary.\n\nRequirements:\n\nAlways start with a short, warm greeting like:\n\"Hello Traveller,\"\n\nAdd a one-line summary with the destination and top highlights. Example:\n\"Here’s your itinerary for your Dubai adventure! Get ready to explore amazing places like Burj Khalifa, Desert Safari, and Dubai Marina.\"\n\nMatch the number of days mentioned in the user's message. Always create a daily breakdown like this:\nDay 1:\nDay 2:\n...\nDay X: (last day should always be departure day)\n\nFor each day, include:\n\nKey activities with rough time slots (e.g., Morning, Afternoon, Evening)\n\nHotel name suggestion (1 per trip or changes if location shifts)\n\nLocal transport tips (Uber, Metro, cab, etc.)\n\nFlight info if available (or mention \"Arrival\" and \"Departure\")\n\nUse a friendly, conversational tone like you're helping a friend.\n\nKeep the language simple, warm, and easy to read.\n\nAvoid emojis, markdown, or extra formatting.\n\nOutput must always follow this exact structure:\n\nSample Output Format:\n\nHello Traveller,\n\nHere’s your itinerary for your [destination] adventure! Get ready to explore amazing places like [a few highlights based on the destination and user’s message].\n\nDay 1: [Arrival details, hotel check-in, and light local activities like a walk or dinner nearby]\nDay 2: [Morning activity, afternoon sightseeing or shopping, evening relaxation or event]\nDay 3: [Full-day excursion or tour, include meal or café options, transport]\nDay 4: [Leisure, beach/mall visit, nightlife or shows, optional spa or market visit]\nDay 5: [Departure day – checkout, transport to airport, and flight info if provided]\n\nBest regards,\nOneclick\n\nExample Input (from email or WhatsApp):\n\"I want to go to Dubai with friends for 5 days\"\n\nExpected Output:\n(Filled-in version of the format above with Dubai-specific content)\n\n\n"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "dfddad63-257b-413a-a05a-c51d66efe223",
      "name": "代理",
      "type": "@n8n/n8n-nodes-langchain.lmOllama",
      "position": [
        -292,
        20
      ],
      "parameters": {
        "model": "llama3.2-16000:latest",
        "options": {}
      },
      "credentials": {
        "ollamaApi": {
          "id": "7td3WzXCW2wNhraP",
          "name": "Ollama - test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8cb4d855-bfcb-4390-890a-5655481a42b2",
      "name": "从邮件获取查询",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -600,
        -300
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "imap": {
          "id": "zTEGYssr7MSVeCs3",
          "name": "IMAP-test"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2b5b9643-e462-4399-b6c4-cfdd4d380a14",
      "name": "从 WhatsApp 获取查询",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -600,
        -100
      ],
      "webhookId": "4aa12180-ecec-4262-8a03-3413bbaba699",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "jt1wbDtaEmlHpPFc",
          "name": "WhatsApp -test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "66b2e41e-8eb4-47fc-a86c-12ac044743e9",
      "name": "检查数据是否正确",
      "type": "n8n-nodes-base.set",
      "position": [
        -4,
        -200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7d428c48-4809-45d8-ba1e-c96d68c02c07",
              "name": "from",
              "type": "string",
              "value": "={{ $('Get Query from Email').first().json.from }}"
            },
            {
              "id": "63b99545-3d2d-4563-b9d7-078cbc20dbcc",
              "name": "subject",
              "type": "string",
              "value": "=Re: {{ $('Get Query from Email').first().json.subject }}"
            },
            {
              "id": "11d94d3f-2170-4b54-b5f9-b85bb95ad472",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }} "
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a0360062-ca48-4d25-85da-de42b60891d0",
      "name": "检查发送答案的位置",
      "type": "n8n-nodes-base.if",
      "position": [
        216,
        -200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0ff6d913-c904-4d59-b582-f5734473939a",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $('Get Query from Email').first().json.from }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1469c633-143d-4b64-b20b-4cbbe4f41ed7",
      "name": "从邮件发送行程",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        436,
        -300
      ],
      "webhookId": "45e836d1-74da-43fa-953f-346be444e4ab",
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {},
        "subject": "={{ $json.subject }}",
        "toEmail": "={{ $json.from }}",
        "fromEmail": "XYZ@gmail.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "G1kyF8cSWTZ4vouN",
          "name": "SMTP -test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d43a04ad-e7df-4af6-a2bd-65ed6c228669",
      "name": "从消息发送行程",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        436,
        -100
      ],
      "webhookId": "050680f6-225d-4e4d-b1af-c8ca0ca0f604",
      "parameters": {
        "textBody": "={{ $json.text }}",
        "operation": "send",
        "phoneNumberId": "=+918888888888",
        "additionalFields": {},
        "recipientPhoneNumber": "+9199999999999"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "b0PxTDPdWzznWnfG",
          "name": "WhatsApp-test "
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2b6ab492-16e5-4a5d-aaec-f335ce640b21",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -520
      ],
      "parameters": {
        "width": 480,
        "height": 180,
        "content": "此工作流根据通过邮件或 WhatsApp 收到的消息,自动创建友好、个性化的旅行行程。无论用户说\"我想和朋友去迪拜玩 5 天\"还是类似内容,代理都能理解请求,生成详细的每日计划,包括建议的活动、交通提示和酒店想法——全部采用温暖、人性化的语气。它节省时间,为旅行者增加价值,并提供无需任何手动操作即可发送的现成行程。"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "364ded48-86f9-48e9-92a0-f56a1fd30d59",
  "connections": {
    "Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Itinerary Creator Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check Proper Data": {
      "main": [
        [
          {
            "node": "Check where to send Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Query from Email": {
      "main": [
        [
          {
            "node": "Itinerary Creator Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Query from WhatsApp": {
      "main": [
        [
          {
            "node": "Itinerary Creator Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Itinerary Creator Agent": {
      "main": [
        [
          {
            "node": "Check Proper Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check where to send Answer": {
      "main": [
        [
          {
            "node": "Sending Itinery from Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send  Itinery from message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send  Itinery from message": {
      "main": [
        []
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 客服机器人, AI 聊天机器人

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量9
分类2
节点类型9
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部链接
在 n8n.io 查看

分享此工作流