Skip to main content

Compare flight prices across multiple booking platforms with email reports

Workflow preview

Workflow preview
100%
Compare flight prices across multiple booking platforms with email reports preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow automates flight price comparison across multiple booking platforms (Kayak, Skyscanner, Expedia, Google Flights). It accepts natural language queries, extracts flight details using NL...

Best for

  • Miscellaneous automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.ssh, n8n-nodes-base.emailsend, n8n-nodes-base.respondtowebhook, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Compare flight prices across multiple booking platforms with email reports
Workflow name
Compare flight prices across multiple booking platforms with email reports

This workflow automates flight price comparison across multiple booking platforms (Kayak, Skyscanner, Expedia, Google Flights). It accepts natural language queries, extracts flight details using NLP, scrapes prices in parallel, identifies the best deals, and sends professional email reports with comprehensive price breakdowns and booking links.

πŸ“¦ What You'll Get

A fully functional, production-ready n8n workflow that:

βœ… Compares flight prices across 4 major platforms (Kayak, Skyscanner, Expedia, Google Flights)
βœ… Accepts natural language requests ("Flight from NYC to London on March 25")
βœ… Sends beautiful email reports with best deals
βœ… Returns real-time JSON responses for web apps
βœ… Handles errors gracefully with helpful messages
βœ… Includes detailed documentation with sticky notes


πŸš€ Quick Setup (3 Steps)

Step 1: Import Workflow to n8n

  1. Copy the JSON from the first artifact (workflow file)
  2. Open n8n β†’ Go to Workflows
  3. Click "Import from File" β†’ Paste JSON β†’ Click Import
  4. βœ… Workflow imported successfully!

Step 2: Setup Python Scraper

On your server (where n8n SSH nodes will connect):

# Navigate to your scripts directory
cd /home/oneclick-server2/

# Create the scraper file
nano flight_scraper.py

# Copy the entire Python script from the second artifact
# Save with Ctrl+X, then Y, then Enter

# Make it executable
chmod +x flight_scraper.py

# Install required packages
pip3 install selenium

# Install Chrome and ChromeDriver
sudo apt update
sudo apt install -y chromium-browser chromium-chromedriver

# Test the scraper
python3 flight_scraper.py JFK LHR 2025-03-25 2025-03-30 round-trip 1 economy kayak

Expected Output:

Delta|$450|7h 30m|0|10:00 AM|6:30 PM|https://kayak.com/...
British Airways|$485|7h 45m|0|11:30 AM|8:15 PM|https://kayak.com/...
...

Step 3: Configure n8n Credentials

A. Setup SMTP (for sending emails):

  1. In n8n: Credentials β†’ Add Credential β†’ SMTP
  2. Fill in details:
    Host: smtp.gmail.com
    Port: 587
    User: [email protected]
    Password: [Your App Password]
    

For Gmail Users:

B. Setup SSH (already configured if you used existing credentials):

  1. In workflow, SSH nodes use: ilPh8oO4GfSlc0Qy
  2. Verify credential exists and points to correct server
  3. Update path if needed: /home/oneclick-server2/

C. Activate Workflow:

  1. Click the workflow toggle β†’ Active βœ…
  2. Webhook is now live!

🎯 How to Use

Method 1: Direct Webhook Call

curl -X POST https://your-n8n-domain.com/webhook/flight-price-compare \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Flight from Mumbai to Dubai on 15th March, round-trip returning 20th March",
    "email": "[email protected]",
    "name": "John Doe"
  }'

Response:

{
  "success": true,
  "message": "Flight comparison sent to [email protected]",
  "route": "BOM β†’ DXB",
  "bestPrice": 450,
  "airline": "Emirates",
  "totalResults": 18
}

Method 2: Natural Language Queries

The workflow understands various formats:

βœ… All these work:

  • "Flight from New York to London on 25th March, one-way"
  • "NYC to LHR March 25 round-trip return March 30"
  • "I need a flight from Mumbai to Dubai departing 15th March"
  • "JFK LHR 2025-03-25 2025-03-30 round-trip"

Supported cities (auto-converts to airport codes):

  • New York β†’ JFK
  • London β†’ LHR
  • Mumbai β†’ BOM
  • Dubai β†’ DXB
  • Singapore β†’ SIN
  • And 20+ more cities

Method 3: Structured JSON

{
  "from": "JFK",
  "to": "LHR",
  "departure_date": "2025-03-25",
  "return_date": "2025-03-30",
  "trip_type": "round-trip",
  "passengers": 1,
  "class": "economy",
  "email": "[email protected]",
  "name": "John"
}

πŸ“§ Email Report Example

Users receive an email like this:

FLIGHT PRICE COMPARISON
==================================================

Route: JFK β†’ LHR
Departure: 25 Mar 2025
Return: 30 Mar 2025
Trip Type: round-trip
Passengers: 1

πŸ† BEST DEAL
--------------------------------------------------
British Airways
Price: $450
Duration: 7h 30m
Stops: Non-stop
Platform: Kayak

πŸ’° Save $85 vs highest price!

πŸ“Š ALL RESULTS (Top 10)
--------------------------------------------------
1. British Airways - $450 (Non-stop) - Kayak
2. Delta - $475 (Non-stop) - Google Flights
3. American Airlines - $485 (Non-stop) - Expedia
4. Virgin Atlantic - $495 (Non-stop) - Skyscanner
5. United - $520 (1 stop) - Kayak
...

Average Price: $495
Total Results: 23

Prices subject to availability.
Happy travels! ✈️

πŸ”§ Customization Options

Change Scraping Platforms

Add more platforms:

  1. Duplicate an SSH scraping node
  2. Change platform parameter: kayak β†’ new-platform
  3. Add scraping logic in flight_scraper.py
  4. Connect to "Aggregate & Analyze Prices" node

Remove platforms:

  1. Delete unwanted SSH node
  2. Workflow continues with remaining platforms

Modify Email Format

Edit the "Format Email Report" node:

// Change to HTML format
const html = `
<!DOCTYPE html>
<html>
<body>
  <h1>Flight Deals</h1>
  <p>Best price: ${bestDeal.currency}${bestDeal.price}</p>
&lt;/body&gt;
&lt;/html&gt;
`;

return [{
  json: {
    subject: "...",
    html: html,  // Instead of text
    ...data
  }
}];

Then update "Send Email Report" node:

  • Change emailFormat to html
  • Use {{$json.html}} instead of {{$json.text}}

Add More Cities/Airports

Edit "Parse & Validate Flight Request" node:

const airportCodes = {
  ...existing codes...,
  'berlin': 'BER',
  'rome': 'FCO',
  'barcelona': 'BCN',
  // Add your cities here
};

Change Timeout Settings

In each SSH node, add:

"timeout": 30000  // 30 seconds

πŸ› Troubleshooting

Issue: "No flights found"

Possible causes:

  1. Scraper script not working
  2. Website structure changed
  3. Dates in past
  4. Invalid airport codes

Solutions:

# Test scraper manually
cd /home/oneclick-server2/
python3 flight_scraper.py JFK LHR 2025-03-25 "" one-way 1 economy kayak

# Check if output shows flights
# If no output, check Chrome/ChromeDriver installation

Issue: "Connection refused" (SSH)

Solutions:

  1. Verify SSH credentials in n8n
  2. Check server is accessible: ssh user@your-server
  3. Verify path exists: /home/oneclick-server2/
  4. Check Python installed: which python3

Issue: "Email not sending"

Solutions:

  1. Verify SMTP credentials
  2. Check email in spam folder
  3. For Gmail: Confirm App Password is used (not regular password)
  4. Test SMTP connection:
    telnet smtp.gmail.com 587
    

Issue: "Webhook not responding"

Solutions:

  1. Ensure workflow is Active (toggle on)
  2. Check webhook path: /webhook/flight-price-compare
  3. Test with curl command (see "How to Use" section)
  4. Check n8n logs: Settings β†’ Log Streaming

Issue: "Scraper timing out"

Solutions:

# In flight_scraper.py, increase wait times
time.sleep(10)  # Instead of time.sleep(5)

# Or increase WebDriverWait timeout
WebDriverWait(driver, 30)  # Instead of 20

πŸ“Š Understanding the Workflow

Node-by-Node Explanation

1. Webhook - Receive Flight Request

  • Entry point for all requests
  • Accepts POST requests
  • Path: /webhook/flight-price-compare

2. Parse & Validate Flight Request

  • Extracts flight details from natural language
  • Converts city names to airport codes
  • Validates required fields
  • Returns helpful errors if data missing

3. Check If Request Valid

  • Routes to scraping if valid
  • Routes to error response if invalid

4-7. Scrape [Platform] (4 nodes)

  • Run in parallel for speed
  • Each calls Python script with platform parameter
  • Continue on failure (don't break workflow)
  • Return pipe-delimited flight data

8. Aggregate & Analyze Prices

  • Collects all scraper results
  • Parses flight data
  • Finds best overall deal
  • Finds best non-stop flight
  • Calculates statistics
  • Sorts by price

9. Format Email Report

  • Creates readable text report
  • Includes route details
  • Highlights best deal
  • Lists top 10 results
  • Shows statistics

10. Send Email Report

  • Sends formatted email to user
  • Uses SMTP credentials

11. Webhook Response (Success)

  • Returns JSON response immediately
  • Includes best price summary
  • Confirms email sent

12. Webhook Response (Error)

  • Returns helpful error message
  • Guides user on what's missing

🎨 Workflow Features

βœ… Included Features

  • Natural Language Processing: Understands flexible input formats
  • Multi-Platform Comparison: 4 major booking sites
  • Parallel Scraping: All platforms scraped simultaneously
  • Error Handling: Graceful failures, helpful messages
  • Email Reports: Professional format with all details
  • Real-Time Responses: Instant webhook feedback
  • Sticky Notes: Detailed documentation in workflow
  • Airport Code Mapping: Auto-converts 20+ cities

🚧 Not Included (Easy to Add)

  • Price Alerts: Monitor price drops (add Google Sheets)
  • Analytics Dashboard: Track searches (add Google Sheets)
  • SMS Notifications: Send via Twilio
  • Slack Integration: Post to channels
  • Database Logging: Store searches in PostgreSQL
  • Multi-Currency: Show prices in the user's currency

πŸ’‘ Pro Tips

Tip 1: Speed Up Scraping

Use faster scraping service (like ScraperAPI):

// Replace SSH nodes with HTTP Request nodes
{
  "url": "http://api.scraperapi.com",
  "qs": {
    "api_key": "YOUR_KEY",
    "url": "https://kayak.com/flights/..."
  }
}

Tip 2: Cache Results

Add caching to avoid duplicate scraping:

// In Parse node, check cache first
const cacheKey = `${origin}-${dest}-${departureDate}`;
const cached = await $cache.get(cacheKey);

if (cached && Date.now() - cached.time &lt; 3600000) {
  return cached.data; // Use 1-hour cache
}

Tip 3: Add More Platforms

Easy to add Momondo, CheapOair, etc.:

  1. Add function in flight_scraper.py
  2. Add SSH node in workflow
  3. Connect to aggregator

Tip 4: Improve Date Parsing

Handle more formats:

// Add to Parse node
const formats = [
  'DD/MM/YYYY',
  'MM-DD-YYYY',
  'YYYY.MM.DD',
  // Add your formats
];

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook - Receive Flight Request

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Parse & Validate Flight Request

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Check If Request Valid

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 4 - Scrape Kayak

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 5 - Scrape Skyscanner

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 6 - Scrape Expedia

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 7 - Scrape Google Flights

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 8 - Aggregate & Analyze Prices

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Format Email Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Send Email Report

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 11 - Webhook Response (Success)

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 12 - Webhook Response (Error)

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 13 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Compare flight prices across multiple booking platforms with email reports
Complexity advanced
Nodes 19
Categories Miscellaneous
Author Oneclick AI Squad
Published 16 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9788/9788.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Compare flight prices across multiple booking platforms with email reports do?

This workflow automates flight price comparison across multiple booking platforms (Kayak, Skyscanner, Expedia, Google Flights). It accepts natural language queries, extracts flight details using NL...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous use case.