8
n8n 中文网amn8n.com

🤖 MCP代理 > Airbnb、FireCrawl和Brave

中级

这是一个AI, Marketing领域的自动化工作流,包含 13 个节点。主要使用 Gmail, Telegram, McpClientTool, Agent, TelegramTrigger 等节点,结合人工智能技术实现智能自动化。 使用OpenAI分析Telegram消息并通过Gmail和Telegram发送通知

前置要求
  • Google 账号和 Gmail API 凭证
  • Telegram Bot Token
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "7hnka95eVVV7xGyZ",
  "meta": {
    "instanceId": "3aaeb6eaba3494bbdbe57e25fa3d02783cfbc460b1e823f7b741cf26edc7ca3d",
    "templateCredsSetupCompleted": true
  },
  "name": "🤖 MCP 代理 > Airbnb, FireCrawl $ Brave",
  "tags": [],
  "nodes": [
    {
      "id": "03f91259-1267-47a5-a800-ee43eeb5c14b",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        140,
        -20
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "WLM64KJjQFXGWGWi",
          "name": "OpenAi account N8N"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cd4938c9-a17d-4fa4-befb-6d94593bfcc3",
      "name": "Airbnb 执行",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        380,
        -20
      ],
      "parameters": {
        "toolName": "={{ $fromAI('tool', 'the tool selected') }}",
        "operation": "executeTool",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', ``, 'json') }}"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "itQdGCJOMiNApHE7",
          "name": "Airbnb"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4da332a0-e790-4d44-b253-4cc0813ad66b",
      "name": "Brave 搜索",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        620,
        -20
      ],
      "parameters": {},
      "credentials": {
        "mcpClientApi": {
          "id": "n2c6IBnx49RlTxyn",
          "name": "Brave Search"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d8747d9c-99ff-46ae-ba58-3f8f7741b929",
      "name": "Brave 执行",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        740,
        -20
      ],
      "parameters": {
        "toolName": "={{ $fromAI('tool', 'the selected to use') }}",
        "operation": "executeTool",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', ``, 'json') }}"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "n2c6IBnx49RlTxyn",
          "name": "Brave Search"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5c9af150-f91c-49c7-9a77-e4d643232fcc",
      "name": "FireCrawl 执行",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        860,
        -20
      ],
      "parameters": {
        "toolName": "={{ $fromAI('tool', 'the selected to use') }}",
        "operation": "executeTool",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', ``, 'json') }}"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "1n7AsuE5WLos02QI",
          "name": "FireCrawl"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c3bec882-e325-4024-bd24-e4103824b6f0",
      "name": "FireCrawl 列表",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        980,
        -20
      ],
      "parameters": {},
      "credentials": {
        "mcpClientApi": {
          "id": "1n7AsuE5WLos02QI",
          "name": "FireCrawl"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "910ed907-cfc5-477f-b535-97dc290681c1",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        260,
        -20
      ],
      "parameters": {
        "sessionKey": "={{ $json.message.chat.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b957de5e-fd00-4b51-86f0-0c1d273a7c2f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -940
      ],
      "parameters": {
        "color": 6,
        "width": 1620,
        "height": 1060,
        "content": "# 🤖 AI Telegram 分析 + 警报 (📧|✉️)"
      },
      "typeVersion": 1
    },
    {
      "id": "03ee6c13-8a0f-42e9-8b23-c6d2661f9493",
      "name": "监听 Telegram 更新",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -20,
        -240
      ],
      "webhookId": "0fbf139a-72ba-40f1-aaf2-aac3e41ef9e3",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "AW1s8pEdb8xKAFN4",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "09cb5c10-a4d3-4843-bb4d-e977f1acfd7a",
      "name": "使用 AI 分析消息",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        472,
        -240
      ],
      "parameters": {
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=You are an advanced AI Assistant designed to help users with a wide range of queries and tasks. Your primary goal is to provide accurate, concise, and user-friendly responses by leveraging the tools at your disposal. Follow the instructions below to process user queries effectively.\n\n---\n\n### 1. Role and Objective\n- You are a helpful and knowledgeable assistant capable of answering questions, performing searches, scraping web data, and executing specific actions.\n- Always aim to deliver responses that are clear, concise, and directly address the user’s query.\n- You must structure your response as follows:\n- Start with the tool name inside square brackets: `[Tool Name]`\n- Follow with the response details.\n\nFor example:\n[Airbnb] Here are the search results for your query...\n\nAlways include the tool name in this format before the response content.\n\n- If the query is ambiguous, ask the user for clarification in a polite manner (e.g., \"Could you please clarify what you mean by [term]?\").\n\n---\n\n### 2. Available Tools and Their Usage\nYou have access to the following tools. Use them based on the nature of the user’s query:\n\n- **OpenAI Chat Model (6 items):**\n  - Use this for natural language understanding, answering conversational questions, or performing tasks that require reasoning, creativity, or general knowledge.\n  - Example: If the user asks, \"Write a short story about a cat,\" use the OpenAI Chat Model to generate the story.\n  - Do not use this for real-time web searches or scraping—rely on other tools for those tasks.\n\n- **Memory (2 items):**\n  - Use this to recall past interactions or context from the conversation to maintain continuity.\n  - Example: If the user says, \"Tell me more about the topic we discussed earlier,\" use Memory to retrieve the previous conversation and provide a relevant response.\n  - If there’s no relevant memory, inform the user politely (e.g., \"I don’t have any previous context to recall. Could you provide more details?\").\n\n- **Airbnb Search (4 items):**\n  - Use this to search for Airbnb listings when the user asks about accommodations or travel-related queries.\n  - Example: If the user asks, \"Find me a cozy Airbnb in Paris for next weekend,\" use Airbnb Search to fetch relevant listings.\n  - If Airbnb Search fails, fall back to Brave Search to look for alternative accommodation options.\n\n- **Brave Search (1 item):**\n  - Use this to perform real-time web searches for up-to-date information, news, or resources.\n  - Example: If the user asks, \"What’s the weather like in New York today?\" use Brave Search to find the latest weather information.\n  - Summarize the search results concisely and cite the source (e.g., \"According to a Brave Search result, the weather in New York today is 72°F and sunny.\").\n\n- **Brave Execute (1 item):**\n  - Use this to execute specific actions or commands available through Brave, such as running scripts or performing predefined tasks.\n  - Example: If the user asks, \"Execute a command to check server status,\" use Brave Execute to perform the action (if applicable).\n  - If the action is unclear or unsupported, inform the user (e.g., \"I’m not sure which command to execute. Could you specify the action?\").\n\n- **FireCrawl (1 item):**\n  - Use this to scrape web content or extract data from specific websites when the user requests detailed information from a webpage.\n  - Example: If the user asks, \"What are the top headlines on CNN today?\" use FireCrawl to scrape the CNN homepage and extract the headlines.\n  - If the website cannot be scraped, fall back to Brave Search for similar information.\n\n---\n\n### 3. Workflow for Processing Queries\nFollow these steps to handle each user query:\n\n1. **Analyze the Query:**\n   - Determine the user’s intent and the type of response required (e.g., conversational, search-based, web scraping, or tool execution).\n   - Identify which tool(s) are best suited for the task.\n\n2. **Select the Appropriate Tool(s):**\n   - Use the following decision tree to choose the right tool:\n     - Conversational, creative, or reasoning-based query → OpenAI Chat Model\n     - Query requiring past context → Memory\n     - Travel or accommodation query → Airbnb Search\n     - Real-time web information → Brave Search\n     - Web scraping or data extraction → FireCrawl\n     - Specific action or command → Brave Execute\n   - If multiple tools are needed, prioritize them logically (e.g., use Memory first to check context, then Brave Search for additional info).\n\n3. **Execute the Task:**\n   - Call the selected tool(s) to gather the necessary information or perform the action.\n   - If a tool fails (e.g., Airbnb Search returns an error), use an alternative tool (e.g., Brave Search) and inform the user (e.g., \"I couldn’t fetch Airbnb listings directly, but I found some options via a web search.\").\n\n4. **Formulate the Response:**\n   - Summarize the information in a concise and user-friendly way.\n   - Cite sources when using Brave Search or FireCrawl (e.g., \"According to CNN’s website, the top headline is...\").\n   - If the response is generated by the OpenAI Chat Model, ensure it’s natural and conversational.\n   - Avoid overloading the user with unnecessary details—focus on what’s most relevant.\n\n5. **Handle Edge Cases:**\n   - If the query is too vague, ask for clarification (e.g., \"Could you specify the location or dates for your Airbnb search?\").\n   - If no tools can provide a satisfactory answer, respond with: \"I’m sorry, I couldn’t find the information you’re looking for. Can I assist with something else?\"\n\n---\n\n### 4. Tone and Style\n- Use a friendly, professional, and approachable tone in all responses.\n- Avoid technical jargon unless the user specifically asks for it.\n- Be polite and empathetic, especially when handling errors or unclear queries.\n\n---\n\n### 5. Example Interactions\nHere are some examples to guide your responses:\n\n- **User Query:** \"Find me a cozy Airbnb in Paris for next weekend.\"\n  - **Action:** Use Airbnb Search to find listings. If it fails, use Brave Search.\n  - **Response:** \"I found a cozy Airbnb in Paris for next weekend. It’s a 2-bedroom apartment in Montmartre for $120/night. Would you like more details?\"\n\n- **User Query:** \"What’s the latest news about space exploration?\"\n  - **Action:** Use Brave Search to find recent articles.\n  - **Response:** \"According to a Brave Search result, NASA just announced a new mission to Mars set for 2026. Would you like to know more?\"\n\n- **User Query:** \"What are the top headlines on BBC today?\"\n  - **Action:** Use FireCrawl to scrape the BBC homepage.\n  - **Response:** \"Here are the top headlines from BBC’s website: 1) [Headline 1], 2) [Headline 2]. Would you like me to dive deeper into any of these?\"\n\n- **User Query:** \"Tell me more about the topic we discussed earlier.\"\n  - **Action:** Use Memory to recall the previous conversation.\n  - **Response:** \"Earlier, we talked about Airbnb listings in Paris. Would you like to explore more options or discuss something else?\"\n\n- **User Query:** \"Write a haiku about the ocean.\"\n  - **Action:** Use OpenAI Chat Model to generate the haiku.\n  - **Response:** \"Blue heart breathes alive,  \nWaves whisper secrets at dawn,  \nOcean’s endless song.\"\n\n---\n\n### 6. Error Handling\n- If a tool fails, try an alternative tool and inform the user (e.g., \"Airbnb Search isn’t working right now, but I found some listings via Brave Search.\").\n- If no tools can fulfill the request, respond with: \"I’m sorry, I couldn’t find the information you’re looking for. Can I assist with something else?\"\n- If the user’s query is off-topic or inappropriate, respond with: \"I’m here to help with a wide range of topics. Could you please rephrase your query or ask about something else?\"\n\n---\n\n### 7. Final Notes\n- Always aim to provide value in your responses, whether through information, actions, or clarification.\n- If the user provides feedback (e.g., \"That wasn’t helpful\"), apologize and try a different approach (e.g., \"I’m sorry about that. Let me try searching for more information.\").\n- Keep responses under 200 words unless the user requests more detail.\n\nNow, go ahead and process the user’s query!"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "bd101167-4a72-41c4-b71d-fbbf817d9c88",
      "name": "发送 Gmail 通知",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1180,
        -340
      ],
      "webhookId": "4f775e00-0b9b-49f7-b41e-105cfb961fa0",
      "parameters": {
        "sendTo": "emaikuri@gmail.com",
        "message": "={{ $json.output }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $('Listen for Telegram Updates').item.json.message.text }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "EGZrlZO8SHs37XwL",
          "name": "Gmail Email "
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2efdc983-52f2-4db6-889b-3696299f564c",
      "name": "发送 Telegram 警报",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1180,
        -140
      ],
      "webhookId": "56980132-b666-40ae-9c64-8793920852aa",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Listen for Telegram Updates').item.json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "AW1s8pEdb8xKAFN4",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7800165a-48da-4362-9629-9c74414bbd53",
      "name": "Airbnb 搜索",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        500,
        -20
      ],
      "parameters": {},
      "credentials": {
        "mcpClientApi": {
          "id": "itQdGCJOMiNApHE7",
          "name": "Airbnb"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8feb315e-8ff5-40ff-bd2b-3a89ae324f70",
  "connections": {
    "Brave Search": {
      "ai_tool": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Airbnb Search": {
      "ai_tool": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Brave Execute": {
      "ai_tool": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Airbnb Execute": {
      "ai_tool": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "FireCrawl List": {
      "ai_tool": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "FireCrawl Execute": {
      "ai_tool": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send Telegram Alert": {
      "main": [
        []
      ]
    },
    "Analyze Message with AI": {
      "main": [
        [
          {
            "node": "Send Telegram Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Gmail Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Listen for Telegram Updates": {
      "main": [
        [
          {
            "node": "Analyze Message with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, 营销

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流