实时航班票价检查器 – 即时比价省钱
这是一个Market Research领域的自动化工作流,包含 19 个节点。主要使用 Set, Merge, Function, EmailSend, HttpRequest 等节点。 比较Skyscanner、印度航空等平台的航班票价,并发送邮件提醒
- •可能需要目标 API 的认证凭证
分类
{
"id": "UqtZtvt1uuLwA0JF",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "实时航班票价检查器 – 即时比价省钱",
"tags": [],
"nodes": [
{
"id": "9e9558e0-9b65-4748-8092-70986a9f11f0",
"name": "Skyscanner API",
"type": "n8n-nodes-base.httpRequest",
"position": [
-40,
0
],
"parameters": {
"url": "https://api.skyscanner.net/flights",
"options": {}
},
"typeVersion": 1
},
{
"id": "4649ae50-1619-49c9-a2f8-2cb6f91ca966",
"name": "印度航空 API",
"type": "n8n-nodes-base.httpRequest",
"position": [
-40,
400
],
"parameters": {
"url": "https://api.airindia.net/flights",
"options": {}
},
"typeVersion": 1
},
{
"id": "a336a80f-c147-4deb-ac14-c508f5db7a36",
"name": "IndiGo API",
"type": "n8n-nodes-base.httpRequest",
"position": [
-40,
600
],
"parameters": {
"url": "https://api.idigo.com/v1/flights",
"options": {}
},
"typeVersion": 1
},
{
"id": "5f4c9323-af1a-45b3-a985-73ed231b0809",
"name": "Akasa Air API",
"type": "n8n-nodes-base.httpRequest",
"position": [
-40,
200
],
"parameters": {
"url": "https://api.akasa.com/v1/flights",
"options": {}
},
"typeVersion": 1
},
{
"id": "66ec44a3-838a-4e81-b03c-c1b5e5f7b796",
"name": "设置计划",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-480,
300
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "e3411c6a-c09b-4e86-bb54-13306212f254",
"name": "设置输入数据",
"type": "n8n-nodes-base.set",
"position": [
-260,
300
],
"parameters": {
"values": {
"string": [
{
"name": "origin",
"value": "={{$node['Set Schedule'].json.body.origin}}"
},
{
"name": "destination",
"value": "={{$node['Set Schedule'].json.body.destination}}"
},
{
"name": "departureDate",
"value": "={{$node['Set Schedule'].json.body.departureDate}}"
},
{
"name": "returnDate",
"value": "={{$node['Set Schedule'].json.body.returnDate}}"
}
]
},
"options": {}
},
"typeVersion": 1
},
{
"id": "6ae53558-26a6-4a4d-b9cf-730423f34c65",
"name": "合并 API 数据",
"type": "n8n-nodes-base.merge",
"inputs": [
"Skyscanner API",
"Travelpayouts API"
],
"position": [
180,
100
],
"parameters": {
"mode": "mergeByIndex"
},
"typeVersion": 1
},
{
"id": "1ef09f04-4142-4997-b400-f53d04700eeb",
"name": "合并两个 API 数据",
"type": "n8n-nodes-base.merge",
"inputs": [
"Skyscanner API",
"Travelpayouts API"
],
"position": [
180,
500
],
"parameters": {
"mode": "mergeByIndex"
},
"typeVersion": 1
},
{
"id": "8e81a16c-2db0-4b71-982c-2ec4874507cf",
"name": "合并所有 API 结果",
"type": "n8n-nodes-base.merge",
"inputs": [
"Skyscanner API",
"Travelpayouts API"
],
"position": [
400,
300
],
"parameters": {
"mode": "mergeByIndex"
},
"typeVersion": 1
},
{
"id": "79344599-53b8-4886-839b-82b149e980ad",
"name": "比较数据并排序价格",
"type": "n8n-nodes-base.function",
"position": [
620,
300
],
"parameters": {
"functionCode": "const results = [];\n\n// Process Skyscanner results\nif ($node['Merge API Results'].json[0].data) {\n $node['Merge API Results'].json[0].data.forEach(flight => {\n results.push({\n provider: 'Skyscanner',\n price: flight.price,\n currency: flight.currency,\n booking_url: flight.booking_url\n });\n });\n}\n\n// Process Travelpayouts results\nif ($node['Merge API Results'].json[1].data) {\n $node['Merge API Results'].json[1].data.forEach(flight => {\n results.push({\n provider: 'Travelpayouts',\n price: flight.price,\n currency: flight.currency,\n booking_url: flight.booking_url\n });\n });\n}\n\n// Sort by price\nresults.sort((a, b) => a.price - b.price);\n\nreturn results;"
},
"typeVersion": 1
},
{
"id": "eaf33691-31a4-46ab-9525-d4d4eb0be91b",
"name": "通过邮件发送响应",
"type": "n8n-nodes-base.emailSend",
"position": [
840,
300
],
"webhookId": "f86081b8-8ff3-4315-8568-320e92e2337f",
"parameters": {
"text": "{json.results}",
"options": {},
"subject": "Real-Time Flight Fare Update",
"toEmail": "abc@gmail.com",
"fromEmail": "xyz@gmail.com",
"emailFormat": "text"
},
"credentials": {
"smtp": {
"id": "G1kyF8cSWTZ4vouN",
"name": "SMTP -test"
}
},
"typeVersion": 2.1
},
{
"id": "222fa851-d70b-4c32-9b1e-28bb3cc89181",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
160
],
"parameters": {
"width": 160,
"height": 360,
"content": "按计划时间触发工作流自动检查航班票价"
},
"typeVersion": 1
},
{
"id": "bda7bcb8-35f0-4996-a1fc-7a09db87e173",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
-100
],
"parameters": {
"color": 6,
"width": 160,
"height": 360,
"content": "将 Skyscanner 和 Akasa Air 的航班数据合并为单一数据集"
},
"typeVersion": 1
},
{
"id": "b1b26d28-6609-4680-b7fd-3cc552864c2b",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
100
],
"parameters": {
"color": 3,
"width": 160,
"height": 360,
"content": "整合所有 API 数据(Skyscanner、Akasa Air、印度航空、IndiGo)为统一结果"
},
"typeVersion": 1
},
{
"id": "53e4599a-3bd4-4597-9661-b6364976a972",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
100
],
"parameters": {
"color": 5,
"width": 160,
"height": 360,
"content": "比较所有航班票价并按价格排序以找到最优惠方案"
},
"typeVersion": 1
},
{
"id": "e4b18281-8c98-4eea-b6af-5948c21cce04",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
100
],
"parameters": {
"color": 4,
"width": 160,
"height": 360,
"content": "通过邮件向用户发送排序后的航班票价比较结果"
},
"typeVersion": 1
},
{
"id": "f05b66c5-8f64-4328-8279-b5fd4b942f5c",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-300,
160
],
"parameters": {
"color": 4,
"width": 160,
"height": 360,
"content": "设置航班搜索的输入参数(如出发地、目的地和日期)"
},
"typeVersion": 1
},
{
"id": "af7323e1-82fc-4a53-a532-0023a3942fde",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-60,
-200
],
"parameters": {
"color": 3,
"width": 160,
"height": 960,
"content": "通过提供的 API 端点从不同航空公司获取实时航班票价数据"
},
"typeVersion": 1
},
{
"id": "6354e9b7-f3de-47c8-b413-a6a38f76afae",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
300
],
"parameters": {
"width": 160,
"height": 360,
"content": "将印度航空和 IndiGo 的航班数据与先前数据集合并"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "2d9aac0c-9714-44de-be94-c806fddd584d",
"connections": {
"IndiGo API": {
"main": [
[
{
"node": "Merge Both API Data",
"type": "main",
"index": 1
}
]
]
},
"Set Schedule": {
"main": [
[
{
"node": "Set Input Data",
"type": "main",
"index": 0
}
]
]
},
"Air India API": {
"main": [
[
{
"node": "Merge Both API Data",
"type": "main",
"index": 0
}
]
]
},
"Akasa Air API": {
"main": [
[
{
"node": "Merge API Data",
"type": "main",
"index": 1
}
]
]
},
"Merge API Data": {
"main": [
[
{
"node": "Merge All API Results",
"type": "main",
"index": 0
}
]
]
},
"Set Input Data": {
"main": [
[
{
"node": "Skyscanner API",
"type": "main",
"index": 0
},
{
"node": "Akasa Air API",
"type": "main",
"index": 0
},
{
"node": "Air India API",
"type": "main",
"index": 0
},
{
"node": "IndiGo API",
"type": "main",
"index": 0
}
]
]
},
"Skyscanner API": {
"main": [
[
{
"node": "Merge API Data",
"type": "main",
"index": 0
}
]
]
},
"Merge Both API Data": {
"main": [
[
{
"node": "Merge All API Results",
"type": "main",
"index": 1
}
]
]
},
"Merge All API Results": {
"main": [
[
{
"node": "Compare Data and Sorting Price",
"type": "main",
"index": 0
}
]
]
},
"Compare Data and Sorting Price": {
"main": [
[
{
"node": "Send Response via Email",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 市场调研
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Oneclick AI Squad
@oneclick-aiThe 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.
分享此工作流