8
n8n 中文网amn8n.com

Airbnb Telegram代理 - 模板

中级

这是一个Support, AI领域的自动化工作流,包含 15 个节点。主要使用 Set, Switch, Telegram, McpClientTool, Agent 等节点,结合人工智能技术实现智能自动化。 Airbnb Telegram代理 - 支持语音的AI驱动住宿搜索

前置要求
  • Telegram Bot Token
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "9ElwM3xJyiw4my1L",
  "meta": {
    "instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
    "templateCredsSetupCompleted": true
  },
  "name": "Airbnb Telegram代理 - 模板",
  "tags": [],
  "nodes": [
    {
      "id": "380df1f8-7d7a-4c50-abd3-cf31b09084e1",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -540,
        320
      ],
      "parameters": {
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "209d3ae6-19c5-455a-88fd-72ebd2ee0807",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -660,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "niikB3HA4fT5WAqt",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c04d2f36-b275-45de-850e-35046a0e21f0",
      "name": "Airbnb MCP客户端 - 列出工具",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        -420,
        320
      ],
      "parameters": {},
      "credentials": {
        "mcpClientApi": {
          "id": "miKKxgV86msS3iHq",
          "name": "MCP Airtable"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6d71b756-431e-4970-a7bf-b5f7f190cc5f",
      "name": "Airbnb MCP客户端 - 执行工具",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        -300,
        320
      ],
      "parameters": {
        "toolName": "={{ $fromAI(\"tool\", \"Das ausgewählte Tool\") }}",
        "operation": "executeTool",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', `Die Parameter für das Tool`, 'json') }}"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "miKKxgV86msS3iHq",
          "name": "MCP Airtable"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3103776d-b39e-431e-a72d-cbaf5dc70ef7",
      "name": "Airbnb代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -568,
        100
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=<system_prompt>\nYOU 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**.\n\nCURRENT DATE AND TIME: {{ $now }}\n\n---\n\n###TOOL USAGE###\n\nYOU HAVE ACCESS TO TWO MCP TOOLS:\n\n- `Airbnb MCP Client - List Tools` → SHOWS ALL AVAILABLE MCP FUNCTIONS\n- `Airbnb MCP Client - Execute Tools` → EXECUTES THE SELECTED TOOL WITH PARAMETERS\n\n⚠️ **IMPORTANT**: ALWAYS RUN `LIST TOOLS` FIRST → THEN `EXECUTE TOOLS` WITH THE APPROPRIATE TOOL!\n\n---\n\n###CHAIN OF THOUGHTS – WORK STEPS###\n\n1. **UNDERSTAND**: ANALYZE THE QUERY (e.g., location, time period, price limit, special requirements)\n2. **BASICS**: CLARIFY WHETHER IT'S ABOUT A LIST, DETAILS, OR COMPARISON\n3. **BREAK DOWN**: PARSE RELEVANT PARAMETERS FROM THE QUERY\n4. **ANALYZE**: CALL `LIST TOOLS` TO GET ALL AVAILABLE OPTIONS\n5. **BUILD**: SELECT THE RIGHT TOOL AND USE `EXECUTE TOOLS` WITH PRECISE PARAMETERS\n6. **FORMAT**: FORMAT THE OUTPUT FOR **MOBILE/TELEGRAM** – NO TABLES!\n7. **FINAL OUTPUT**: FOR EACH ACCOMMODATION, USE THIS FORMAT:\n\n🏡 {Accommodation Name}\n🛏️ {Beds, Bedrooms}\n💶 {Price/Night} – Total: {Total Price}\n✨ {Special Feature, if available}\n🔗 [View]({URL to accommodation})\n\n📌 *IMPORTANT: THE URL MUST BE WITHIN THE BRACKETS, OTHERWISE THE LINK WON'T BE CLICKABLE ON TELEGRAM!*\n\n---\n\n###EXAMPLE OUTPUT FOR TELEGRAM###\n\nHere are accommodations in Allgäu for 2 people from May 28-30, 2025:\n\n🏡 Sandra's apartment in the countryside\n🛏️ 2 beds\n💶 €82/night – Total: €164\n✨ Guest favorite\n🔗 View\n\n🏡 Villa Kunterbunt in Allgäu\n🛏️ 2 single beds\n💶 €137/night – Total: €274\n✨ Guest favorite\n🔗 View\n\n🔎 More results & filters:\n→ All accommodations for 2 people in Allgäu (May 28-30, 2025)\n\n👉 Let me know if you want details about any accommodation like amenities, photos, or cancellation policies!\n</system_prompt>"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "3860e787-78a7-4211-a7c3-f4b3fcf4fb60",
      "name": "Telegram触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1540,
        100
      ],
      "webhookId": "6596b191-7b90-41ed-ad04-b84340d8d3d6",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "8FPdItv7hTnpO77J",
          "name": "Airtable Agent Bot"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "442e9229-5576-4193-a629-b7343eb62f1b",
      "name": "文本或语音",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1320,
        100
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7c629699-9dd6-4a75-9b76-d796875f9ac9",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0e56bc7f-c754-4f5e-9ddd-7124e1f5d998",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.voice }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "6ecbc049-1c0d-4e93-886a-6a99f584dfd3",
      "name": "获取语音消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1100,
        200
      ],
      "webhookId": "b77489ac-fd9d-4ed6-94eb-f646d292bfb2",
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file"
      },
      "credentials": {
        "telegramApi": {
          "id": "8FPdItv7hTnpO77J",
          "name": "Airtable Agent Bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c88de1a5-d775-467d-99ba-ee2bba985109",
      "name": "为AI代理准备文本消息",
      "type": "n8n-nodes-base.set",
      "position": [
        -880,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a5bcf087-7580-4904-88d3-ca29614fc923",
              "name": "text",
              "type": "string",
              "value": "={{ $json.message.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ffb9dfef-5b76-446f-9b4f-cb6ea1766375",
      "name": "发送文本回复",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -22,
        0
      ],
      "webhookId": "2b263d0d-6a0e-4319-8c5b-5916faba83a8",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "8FPdItv7hTnpO77J",
          "name": "Airtable Agent Bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "afbe65f9-8576-4217-8eea-4413a8aa8657",
      "name": "发送语音回复",
      "type": "n8n-nodes-base.telegram",
      "position": [
        496,
        200
      ],
      "webhookId": "17ddaf92-7e24-4ca9-a4e0-74aabea37e20",
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "operation": "sendAudio",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "8FPdItv7hTnpO77J",
          "name": "Airtable Agent Bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e1171f41-47e0-4821-80fa-d1350c6b6d99",
      "name": "创建语音回复",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        276,
        200
      ],
      "parameters": {
        "input": "={{ $json.text }}",
        "options": {},
        "resource": "audio"
      },
      "credentials": {
        "openAiApi": {
          "id": "niikB3HA4fT5WAqt",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "c31a642c-068f-4b63-ac89-4530377f8a52",
      "name": "语音回复摘要",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -100,
        200
      ],
      "parameters": {
        "text": "=Summarize the given input briefly and clearly for voice output. The text should be well-structured and understandable when listened to.\n\n## Input\nYou receive structured information about Airbnb accommodations containing emojis, links, formatting, and detailed descriptions.\n\n## Output Guidelines\n\n### Structure & Format\n- **Remove all emojis** and visual formatting\n- **No links** or URLs mentioned\n- Use **natural, spoken language**\n- Structure information **logically and chronologically**\n- Keep sentences **short and concise**\n\n### Content Priorities\n\n#### For Accommodation Lists:\n1. **Mention number of found accommodations**\n2. **Price range** (cheapest to most expensive option)\n3. **2-3 most interesting options** with name, price, and key feature\n4. Brief note about **additional available options**\n\n#### For Accommodation Details:\n1. **Name and basic data** (guest count, room type)\n2. **Price per night**\n3. **3-4 most important amenities**\n4. **Key house rules** (check-in/out, guest limit)\n5. **Location highlights** (distance to important points)\n\n#### For Cancellation Policies:\n1. **Type of cancellation policy** (flexible/moderate/strict)\n2. **Deadlines for free cancellation**\n3. **Refund rates** after cancellation deadlines\n4. **Important note** that final conditions are shown at booking\n\n### Language Style\n- Use **\"you\"** as address form\n- **Direct, friendly language**\n- **No technical terms** without explanation\n- **Spell out numbers** up to twenty\n- **Time references** in natural form (\"seven days before\" instead of \"7 days\")\n\n### Length\n- **Maximum 150 words** for lists\n- **Maximum 100 words** for single objects\n- **Maximum 80 words** for cancellation policies\n\n## Example Transformation\n\n**Input:** Long formatted list with 7 accommodations, emojis, links\n**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.\"\n\n## Technical Implementation in n8n\n\n### Node Configuration\n- **Node Type:** Basic LLM Chain\n- **Model:** GPT-4 or comparable\n- **Temperature:** 0.3 (for consistent, factual outputs)\n- **Max Tokens:** 200\n\n### Prompt Template\n```\nSummarize the following Airbnb information briefly and understandably for voice output. \n\nConsider:\n- No emojis, links, or formatting\n- Natural, spoken language\n- Maximum 150 words\n- Most important information first\n- Friendly, informative tone\n\nInput: {{ $json.output }}\n\nSummary:\n```\n\n### Input Mapping\n- Connect the output of the previous node with the `input` parameter\n- Use the `output` property of the JSON array as input\n\n### Output Processing\n- The summarized text can be passed directly to Text-to-Speech services\n- Or for further processing in downstream nodes",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "598891da-ece9-4ef1-a3a7-bcc11ab31d19",
      "name": "转录语音消息",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -880,
        200
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "niikB3HA4fT5WAqt",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "5b9a2516-4b8e-42c2-869d-1f8d85d279ba",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2620,
        -480
      ],
      "parameters": {
        "width": 1040,
        "height": 1280,
        "content": "# 欢迎使用我的Airbnb Telegram代理工作流!"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Airbnb Agent": [
      {
        "json": {
          "output": "Hier sind Unterkünfte in Scheveningen für 1 Person vom 31. Mai (Samstag) bis 1. Juni 2025 (Sonntag):\n\n🏡 Comfort double room | Hotel Corel\n🛏️ 1 Doppelbett\n💶 €156/Nacht – Total: €156\n🔗 [View](https://www.airbnb.com/rooms/810809021737050160)\n\n🏡 Cozy room near the city center and the beach!\n🛏️ Einzelzimmer\n💶 €91/Nacht – Total: €91\n🔗 [View](https://www.airbnb.com/rooms/1148459085653934403)\n\n🏡 Go see Peace Palace – an easy 15-min walk\n🛏️ 2 Einzelbetten\n💶 €164/Nacht – Total: €164\n🔗 [View](https://www.airbnb.com/rooms/1257252023824017600)\n\n🏡 Peaceful room, King size bed, Big Balcony, Centre\n🛏️ King-Size-Bett\n💶 €123/Nacht – Total: €123\n🔗 [View](https://www.airbnb.com/rooms/3874587)\n\n🏡 Studio Apartment at Cove Centrum\n🛏️ 1 Doppelbett\n💶 €209/Nacht – Total: €209\n✨ Superhost\n🔗 [View](https://www.airbnb.com/rooms/559146820973459936)\n\n🏡 The Hague City Center Studio Appartement Brand New\n🛏️ 2 Betten\n💶 €146/Nacht – Total: €146\n✨ Guest favorite\n🔗 [View](https://www.airbnb.com/rooms/34312629)\n\n🔎 Mehr Ergebnisse & weitere Filter:\n→ [Alle Unterkünfte für 1 Person in Scheveningen (31.05.–01.06.2025)](https://www.airbnb.com/s/Scheveningen/homes?checkin=2025-05-31&checkout=2025-06-01&adults=1&children=0&infants=0&pets=0)\n\n👉 Sag Bescheid, wenn du Infos zu Ausstattung, Fotos oder Stornierung brauchst!"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b2664114-a335-4dbb-a47b-0feebed5807d",
  "connections": {
    "Airbnb Agent": {
      "main": [
        [
          {
            "node": "Send Text Response",
            "type": "main",
            "index": 0
          },
          {
            "node": "Summarize Response for Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Airbnb Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Text or Voice": {
      "main": [
        [
          {
            "node": "Prepare Text Message for AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Text or Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Voice Message": {
      "main": [
        [
          {
            "node": "Transcribe Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Airbnb Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Summarize Response for Voice",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Voice Response": {
      "main": [
        [
          {
            "node": "Send Voice Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Voice Message": {
      "main": [
        [
          {
            "node": "Airbnb Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Response for Voice": {
      "main": [
        [
          {
            "node": "Create Voice Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airbnb MCP Client - List Tools": {
      "ai_tool": [
        [
          {
            "node": "Airbnb Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Airbnb MCP Client - Execute Tools": {
      "ai_tool": [
        [
          {
            "node": "Airbnb Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Text Message for AI Agent": {
      "main": [
        [
          {
            "node": "Airbnb Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客户支持, 人工智能

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流