ChatGPT软件基础设施AI 评分 · 78/100AI 辅助编辑·未发现明显提示词注入风险n8n.io

Airbnb Telegram 智能订房助手:语音与文字自然语言搜索

输入 Telegram 消息(文字或语音)→ n8n 工作流识别意图 → AI Agent 调用 MCP 工具查询 Airbnb → 输出移动端优化结果(文字或语音回复)

有一点经验步骤流程提示词贴士
给谁
已在自托管 n8n 上运行工作流、需要为 Telegram 搭建 Airbnb 搜索机器人的搭建者
你会得到
用户通过 Telegram 以自然语言或语音查询住宿,机器人返回带可点击链接、价格、特色的移动端友好结果,并可选语音播报摘要
你需要
n8n · telegram

硬约束

前置条件:自托管 n8n 实例(不支持 Cloud);安装 n8n-nodes-mcp-client 社区节点;准备三类凭证:OpenAI API(用于 Whisper 转录、GPT-4.1 对话、TTS 语音合成)、Telegram Bot API(通过 @BotFather 创建并获取 token)、MCP Client API(需自建 MCP server 连接 Airbnb/Airtable 数据源)。额外需要:在 Telegram Trigger 中更新目标 chat ID;在 Airbnb Agent 中按需修改 system prompt。费用取决于 OpenAI API 调用量与自托管基础设施。

他们做了什么

作者 freddy-schuetz 在 n8n 官方模板库发布了一个工作流模板,用于搭建 Airbnb Telegram 订房助手。该工作流通过 Telegram Trigger 接收用户消息,利用 Switch 节点区分文字与语音:语音路径先下载文件再用 OpenAI Whisper 转录,文字路径直接提取 message.text。核心 Airbnb Agent 使用 gpt-4.1 模型,配合 Simple Memory(以 Telegram chat id 为 session key)维持多轮上下文,并通过两个 MCP Client Tool 节点(List Tools / Execute Tools)动态查询 Airbnb 数据。Agent 的系统提示词规定了 7 步思维链与 Telegram 移动端输出格式(含可点击链接)。Agent 输出后,一路经 Telegram 发送格式化文本,另一路经 Basic LLM Chain 做语音摘要(去 emoji、去链接、控制 150 词内),再经 OpenAI TTS 生成语音文件发回 Telegram。

效果如何

模板页展示了示例输出(pinData):当查询 Scheveningen 单人住宿时,Agent 返回了 7 条带 emoji、价格、可点击链接的房源列表,并附有更多结果筛选链接。语音路径的输出经 Summarize 节点压缩为自然口语摘要后由 TTS 播报。作者声明该模板仅支持自托管 n8n,需额外安装 MCP 社区节点并自建 MCP server。(author_report)

值得知道

1. 自托管限制:该工作流明确不兼容 n8n Cloud,必须自托管并安装 n8n-nodes-mcp-client 社区节点。 2. MCP server 依赖:Airbnb 数据并非直连 Airbnb 官方 API,而是通过用户自建的 MCP server(文档指向 Airtable/Airbnb 连接)提供;模板未包含 MCP server 的实现细节。 3. 凭证与费用:需要有效的 OpenAI API(GPT-4.1、Whisper、TTS 均计费)、Telegram bot token、以及 MCP client 凭证;实际费用取决于调用量。 4. 可配置点:Telegram chat ID 需在 Trigger 中更新;system prompt 可按业务场景修改;语音摘要节点参数(temperature 0.3, max tokens 200)为模板建议值。 5. 语言注意:示例输出中出现德语房源描述,表明 Agent 输出语言可能随查询或数据源变化,非固定英语。

n8n 工作流模板

结构已检查 · 未实际运行

下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。

配置与测试清单

需要绑定的凭证

  • OpenAI Chat Model 节点:绑定OpenAI API 凭证。
  • Airbnb MCP Client - List Tools 节点:绑定mcpClientApi 凭证。
  • Airbnb MCP Client - Execute Tools 节点:绑定mcpClientApi 凭证。
  • Telegram Trigger 节点:绑定Telegram API 凭证。
  • Get Voice Message 节点:绑定Telegram API 凭证。
  • Send Text Response 节点:绑定Telegram API 凭证。
  • Send Voice Response 节点:绑定Telegram API 凭证。
  • Create Voice Response 节点:绑定OpenAI API 凭证。
  • Transcribe Voice Message 节点:绑定OpenAI API 凭证。

需要替换的配置

  • 源模板来自 n8n 公开库 #4494(约 15 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
  • Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。

测试输入与预期结果

  • 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
  • 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。

模板处理说明

  • 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
  • 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。

模板获取日期: 2026-10-24

步骤

  1. 配置凭证与安装社区节点

    在自托管 n8n 实例中,进入 Settings > Community nodes,安装 n8n-nodes-mcp-client。随后在 Credentials 中分别创建:openAiApi(用于语言模型与语音)、telegramApi(通过 @BotFather 获取 bot token 并配置 webhook)、mcpClientApi(指向自建 MCP server)。

  2. 设置 Telegram Trigger 与消息路由

    添加 Telegram Trigger 节点,选择 updates 包含 message;在 additionalFields 中按需配置。随后添加 Switch 节点(Text or Voice),设置两条路由规则:当 $json.message.text 非空时走 Text 分支;当 $json.message.voice 存在时走 Voice 分支。

  3. 处理语音或准备文本输入

    Voice 分支:先以 Telegram 节点(Get Voice Message)通过 file_id 下载语音文件,再经 OpenAI 节点(Transcribe Voice Message)使用 Whisper 转录为文字。Text 分支:使用 Edit Fields(Set)节点将 $json.message.text 提取为 text 字段。两条分支最终都输出包含 text 的 JSON,供下游 Agent 使用。

  4. 配置 Airbnb AI Agent 与系统提示词

    添加 AI Agent 节点(Airbnb Agent),连接 Simple Memory(sessionKey 取 Telegram chat id 以实现上下文记忆)与 OpenAI Chat Model(模型选 gpt-4.1)。在 Agent 的 systemMessage 中粘贴模板提供的 system prompt,定义 MCP 工具调用顺序、7 步思维链与 Telegram 移动端输出格式。同时连接两个 MCP Client Tool 节点:List Tools(无参数)与 Execute Tools(toolName 与 toolParameters 通过 $fromAI 动态注入)。

    运行提示词 · 来源原文。Airbnb Agent 节点的 systemMessage 字段(promptType=define)

    =<system_prompt>
    YOU ARE A HIGHLY SPECIALIZED **AIRBNB EXPERT AGENT** INTEGRATED INTO **n8n**. YOUR TASK IS TO ANSWER AIRBNB ACCOMMODATION QUERIES PRECISELY BY USING THE **MCP (Modular Command Platform)** AND PRESENTING THE INFORMATION IN **MOBILE-FRIENDLY FORMAT FOR TELEGRAM**.
    
    CURRENT DATE AND TIME: {{ $now }}
    
    ---
    
    ###TOOL USAGE###
    
    YOU HAVE ACCESS TO TWO MCP TOOLS:
    
    - `Airbnb MCP Client - List Tools` → SHOWS ALL AVAILABLE MCP FUNCTIONS
    - `Airbnb MCP Client - Execute Tools` → EXECUTES THE SELECTED TOOL WITH PARAMETERS
    
    ⚠️ **IMPORTANT**: ALWAYS RUN `LIST TOOLS` FIRST → THEN `EXECUTE TOOLS` WITH THE APPROPRIATE TOOL!
    
    ---
    
    ###CHAIN OF THOUGHTS – WORK STEPS###
    
    1. **UNDERSTAND**: ANALYZE THE QUERY (e.g., location, time period, price limit, special requirements)
    2. **BASICS**: CLARIFY WHETHER IT'S ABOUT A LIST, DETAILS, OR COMPARISON
    3. **BREAK DOWN**: PARSE RELEVANT PARAMETERS FROM THE QUERY
    4. **ANALYZE**: CALL `LIST TOOLS` TO GET ALL AVAILABLE OPTIONS
    5. **BUILD**: SELECT THE RIGHT TOOL AND USE `EXECUTE TOOLS` WITH PRECISE PARAMETERS
    6. **FORMAT**: FORMAT THE OUTPUT FOR **MOBILE/TELEGRAM** – NO TABLES!
    7. **FINAL OUTPUT**: FOR EACH ACCOMMODATION, USE THIS FORMAT:
    
    🏡 {Accommodation Name}
    🛏️ {Beds, Bedrooms}
    💶 {Price/Night} – Total: {Total Price}
    ✨ {Special Feature, if available}
    🔗 [View]({URL to accommodation})
    
    📌 *IMPORTANT: THE URL MUST BE WITHIN THE BRACKETS, OTHERWISE THE LINK WON'T BE CLICKABLE ON TELEGRAM!*
    
    ---
    
    ###EXAMPLE OUTPUT FOR TELEGRAM###
    
    Here are accommodations in Allgäu for 2 people from May 28-30, 2025:
    
    🏡 Sandra's apartment in the countryside
    🛏️ 2 beds
    💶 €82/night – Total: €164
    ✨ Guest favorite
    🔗 View
    
    🏡 Villa Kunterbunt in Allgäu
    🛏️ 2 single beds
    💶 €137/night – Total: €274
    ✨ Guest favorite
    🔗 View
    
    🔎 More results & filters:
    → All accommodations for 2 people in Allgäu (May 28-30, 2025)
    
    👉 Let me know if you want details about any accommodation like amenities, photos, or cancellation policies!
    </system_prompt>
  5. 发送文本回复

    添加 Telegram 节点(Send Text Response),设置 chatId 为 $('Telegram Trigger').item.json.message.chat.id,text 为 $json.output,并关闭 appendAttribution。此节点接收 Agent 输出,直接返回格式化文本到用户对话。

  6. 生成并发送语音回复(可选)

    从 Agent 输出并联接入 Basic LLM Chain 节点(Summarize Response for Voice),连接同一 OpenAI Chat Model。节点内粘贴语音摘要 prompt,将结构化结果去 emoji、去链接、转为自然口语,限制 150 词以内。摘要输出接入 OpenAI 节点(Create Voice Response,resource=audio)生成语音文件,最后经 Telegram 节点(Send Voice Response,operation=sendAudio)发送回用户。

    运行提示词 · 来源原文。Summarize Response for Voice 节点的 text 字段(promptType=define)

    =Summarize the given input briefly and clearly for voice output. The text should be well-structured and understandable when listened to.
    
    ## Input
    You receive structured information about Airbnb accommodations containing emojis, links, formatting, and detailed descriptions.
    
    ## Output Guidelines
    
    ### Structure & Format
    - **Remove all emojis** and visual formatting
    - **No links** or URLs mentioned
    - Use **natural, spoken language**
    - Structure information **logically and chronologically**
    - Keep sentences **short and concise**
    
    ### Content Priorities
    
    #### For Accommodation Lists:
    1. **Mention number of found accommodations**
    2. **Price range** (cheapest to most expensive option)
    3. **2-3 most interesting options** with name, price, and key feature
    4. Brief note about **additional available options**
    
    #### For Accommodation Details:
    1. **Name and basic data** (guest count, room type)
    2. **Price per night**
    3. **3-4 most important amenities**
    4. **Key house rules** (check-in/out, guest limit)
    5. **Location highlights** (distance to important points)
    
    #### For Cancellation Policies:
    1. **Type of cancellation policy** (flexible/moderate/strict)
    2. **Deadlines for free cancellation**
    3. **Refund rates** after cancellation deadlines
    4. **Important note** that final conditions are shown at booking
    
    ### Language Style
    - Use **"you"** as address form
    - **Direct, friendly language**
    - **No technical terms** without explanation
    - **Spell out numbers** up to twenty
    - **Time references** in natural form ("seven days before" instead of "7 days")
    
    ### Length
    - **Maximum 150 words** for lists
    - **Maximum 100 words** for single objects
    - **Maximum 80 words** for cancellation policies
    
    ## Example Transformation
    
    **Input:** Long formatted list with 7 accommodations, emojis, links
    **Output:** "I found seven accommodations in Scheveningen for May thirty-first. Prices range from seventy-three to two hundred nine euros per night. Particularly interesting are the affordable room near TU Delft for seventy-three euros, the cozy room near beach and center for ninety-one euros, and the studio apartment with Superhost status for two hundred nine euros. All accommodations offer various amenities and locations to choose from."
    
    ## Technical Implementation in n8n
    
    ### Node Configuration
    - **Node Type:** Basic LLM Chain
    - **Model:** GPT-4 or comparable
    - **Temperature:** 0.3 (for consistent, factual outputs)
    - **Max Tokens:** 200
    
    ### Prompt Template
    ```
    Summarize the following Airbnb information briefly and understandably for voice output. 
    
    Consider:
    - No emojis, links, or formatting
    - Natural, spoken language
    - Maximum 150 words
    - Most important information first
    - Friendly, informative tone
    
    Input: {{ $json.output }}
    
    Summary:
    ```
    
    ### Input Mapping
    - Connect the output of the previous node with the `input` parameter
    - Use the `output` property of the JSON array as input
    
    ### Output Processing
    - The summarized text can be passed directly to Text-to-Speech services
    - Or for further processing in downstream nodes

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限

这一段是提示词,页面不会在这里插入广告。

你是一位熟悉 n8n 与 Telegram 机器人搭建的助手。请根据以下信息帮助用户复现该 Airbnb 搜索助手工作流:

1. 确认用户拥有自托管 n8n 实例,并已安装 n8n-nodes-mcp-client 社区节点。
2. 协助配置三类凭证:OpenAI API、Telegram Bot API(@BotFather)、MCP Client API(需自建 MCP server 连接 Airbnb/Airtable)。
3. 导入 workflow.json 后,检查 Telegram Trigger 的 chat ID 与 webhook 设置。
4. 验证 Airbnb Agent 的 system prompt 是否完整粘贴,MCP 工具节点是否正确连接为 List Tools + Execute Tools。
5. 测试文本查询与语音消息两条路径,确认输出格式为移动端友好的 emoji 列表且链接可点击。

注意:该模板仅适用于自托管 n8n;MCP server 需用户自行搭建并配置数据源。

粘贴此提示词给搭建助手前,请准备好 OpenAI API key、Telegram bot token,以及 MCP server 的接入信息。

来源

Airbnb Telegram agent - AI-powered accommodation search with voice support · freddy-schuetz · n8n.io · 2025-05-29

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例