Skip to main content

Automate hotel price comparison with multi-platform scraping and email reporting

Workflow preview

Workflow preview
100%
Automate hotel price comparison with multi-platform scraping and email reporting 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 is a production ready, end to end workflow that automatically compares hotel prices across multiple booking platforms and delivers beautiful email reports to users. Unlike basic building block...

Best for

  • Market Research 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.httprequest, n8n-nodes-base.emailsend, n8n-nodes-base.respondtowebhook, n8n-nodes-base.set, n8n-nodes-base.googlesheets

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
Automate hotel price comparison with multi-platform scraping and email reporting
Workflow name
Automate hotel price comparison with multi-platform scraping and email reporting

This is a production-ready, end-to-end workflow that automatically compares hotel prices across multiple booking platforms and delivers beautiful email reports to users. Unlike basic building blocks, this workflow is a complete solution ready to deploy.


✨ What Makes This Production-Ready

✅ Complete End-to-End Automation

  • Input: Natural language queries via webhook
  • Processing: Multi-platform scraping & comparison
  • Output: Professional email reports + analytics
  • Feedback: Real-time webhook responses

✅ Advanced Features

  • 🧠 Natural Language Processing for flexible queries
  • 🔄 Parallel scraping from multiple platforms
  • 📊 Analytics tracking with Google Sheets integration
  • 💌 Beautiful HTML email reports
  • 🛡️ Error handling and graceful degradation
  • 📱 Webhook responses for real-time feedback

✅ Business Value

  • For Travel Agencies: Instant price comparison service for clients
  • For Hotels: Competitive pricing intelligence
  • For Travelers: Save time and money with automated research

🚀 Setup Instructions

Step 1: Import Workflow

  1. Copy the workflow JSON from the artifact
  2. In n8n, go to WorkflowsImport from File/URL
  3. Paste the JSON and click Import

Step 2: Configure Credentials

A. SMTP Email (Required)
Settings → Credentials → Add Credential → SMTP

Host: smtp.gmail.com (for Gmail)
Port: 587
User: [email protected]
Password: your-app-password (not regular password!)

Gmail Setup:

  1. Enable 2FA on your Google Account
  2. Generate App Password: https://myaccount.google.com/apppasswords
  3. Use the generated password in n8n
B. Google Sheets (Optional - for analytics)
Settings → Credentials → Add Credential → Google Sheets OAuth2

Follow the OAuth flow to connect your Google account

Sheet Setup:

  1. Create a new Google Sheet
  2. Name the first sheet "Analytics"
  3. Add headers: timestamp, query, hotel, city, checkIn, checkOut, bestPrice, platform, totalResults, userEmail
  4. Copy the Sheet ID from URL and paste in the "Save to Google Sheets" node

Step 3: Set Up Scraping Service

You need to create a scraping API that the workflow calls. Here are your options:

Option A: Use Your Existing Python Script

Create a simple Flask API wrapper:

# api_wrapper.py
from flask import Flask, request, jsonify
import subprocess
import json

app = Flask(__name__)

@app.route('/scrape/<platform>', methods=['POST'])
def scrape(platform):
    data = request.json
    query = f"{data['checkIn']} to {data['checkOut']}, {data['hotel']}, {data['city']}"
    
    try:
        result = subprocess.run(
            ['python3', 'price_scrap_2.py', query, platform],
            capture_output=True,
            text=True,
            timeout=30
        )
        
        # Parse your script output
        output = result.stdout
        # Assuming your script returns price data
        
        return jsonify({
            'price': extracted_price,
            'currency': 'USD',
            'roomType': 'Standard Room',
            'url': booking_url,
            'availability': True
        })
    except Exception as e:
        return jsonify({'error': str(e)}), 500

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)

Deploy:

pip install flask
python api_wrapper.py

Update n8n HTTP Request nodes:

URL: http://your-server-ip:5000/scrape/booking
URL: http://your-server-ip:5000/scrape/agoda
URL: http://your-server-ip:5000/scrape/expedia
Option B: Use Third-Party Scraping Services

Recommended Services:

  • ScraperAPI (scraperapi.com) - $49/month for 100k requests
  • Bright Data (brightdata.com) - Pay as you go
  • Apify (apify.com) - Has pre-built hotel scrapers

Example with ScraperAPI:

// In HTTP Request node
URL: http://api.scraperapi.com
Query Parameters:
  api_key: YOUR_API_KEY
  url: https://booking.com/search?hotel={{$json.hotelName}}...
Option C: Use n8n SSH Node (Like Your Original)

Keep your SSH approach but improve it:

  1. Replace HTTP Request nodes with SSH nodes
  2. Point to your server with the Python script
  3. Ensure error handling and timeouts
// SSH Node Configuration
Host: your-server-ip
Command: python3 /path/to/price_scrap_2.py "{{$json.hotelName}}" "{{$json.city}}" "{{$json.checkInISO}}" "{{$json.checkOutISO}}" "booking"

Step 4: Activate Webhook

  1. Click on "Webhook - Receive Request" node
  2. Click "Listen for Test Event"
  3. Copy the webhook URL (e.g., https://your-n8n.com/webhook/hotel-price-check)
  4. Test with this curl command:
curl -X POST https://your-n8n.com/webhook/hotel-price-check \
  -H "Content-Type: application/json" \
  -d '{
    "message": "I want to check Marriott Hotel in Singapore from 15th March to 18th March",
    "email": "[email protected]",
    "name": "John Doe"
  }'

Step 5: Activate Workflow

  1. Toggle the workflow to Active
  2. The webhook is now live and ready to receive requests

📝 Usage Examples

Example 1: Basic Query

{
  "message": "Hilton Hotel in Dubai from 20th December to 23rd December",
  "email": "[email protected]",
  "name": "Sarah"
}

Example 2: Flexible Format

{
  "message": "I need prices for Taj Hotel, Mumbai. Check-in: 5th January, Check-out: 8th January",
  "email": "[email protected]"
}

Example 3: Short Format

{
  "message": "Hyatt Singapore March 10 to March 13",
  "email": "[email protected]"
}

🎨 Customization Options

1. Add More Booking Platforms

Steps:

  1. Duplicate an existing "Scrape" node
  2. Update the platform parameter
  3. Connect it to "Aggregate & Compare"
  4. Update the aggregation logic to include the new platform

2. Change Email Template

Edit the "Format Email Report" node's JavaScript:

  • Modify HTML structure
  • Change colors (currently purple gradient)
  • Add your company logo
  • Include terms and conditions

3. Add SMS Notifications

Using Twilio:

  1. Add new node: Twilio → Send SMS
  2. Connect after "Aggregate & Compare"
  3. Format: "Best deal: ${hotel} at ${platform} for ${price}"

4. Add Slack Integration

  1. Add Slack node after "Aggregate & Compare"
  2. Send to #travel-deals channel
  3. Include quick booking links

5. Implement Caching

Add Redis or n8n's built-in cache:

// Before scraping, check cache
const cacheKey = `${hotelName}-${city}-${checkIn}-${checkOut}`;
const cached = await $cache.get(cacheKey);

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

📊 Analytics & Monitoring

Google Sheets Dashboard

The workflow automatically logs to Google Sheets. Create a dashboard with:

Metrics to track:

  • Total searches per day/week
  • Most searched hotels
  • Most searched cities
  • Average price ranges
  • Platform with best prices (frequency)
  • User engagement (repeat users)

Example Sheet Formulas:

// Total searches today
=COUNTIF(A:A, TODAY())

// Most popular hotel
=INDEX(C:C, MODE(MATCH(C:C, C:C, 0)))

// Average best price
=AVERAGE(G:G)

Set Up Alerts

Add a node after "Aggregate & Compare":

// Alert if prices are unusually high
if (bestDeal.price > avgPrice * 1.5) {
  // Send alert to admin
  return [{
    json: {
      alert: true,
      message: `High prices detected for ${hotelName}`
    }
  }];
}

🛡️ Error Handling

The workflow includes comprehensive error handling:

1. Missing Information

If user doesn't provide hotel/city/dates → Responds with helpful prompt

2. Scraping Failures

If all platforms fail → Sends "No results" email with suggestions

3. Partial Results

If some platforms work → Shows available results + notes errors

4. Email Delivery Issues

Uses continueOnFail: true to prevent workflow crashes


🔒 Security Best Practices

1. Rate Limiting

Add rate limiting to prevent abuse:

// In Parse & Validate node
const userEmail = $json.email;
const recentSearches = await $cache.get(`searches:${userEmail}`);

if (recentSearches && recentSearches.length > 10) {
  return [{
    json: {
      status: 'rate_limited',
      response: 'Too many requests. Please try again in 1 hour.'
    }
  }];
}

2. Input Validation

Already implemented - validates hotel names, cities, dates

3. Email Verification

Add email verification before first use:

// Send verification code
const code = Math.random().toString(36).substring(7);
await $sendEmail({
  to: userEmail,
  subject: 'Verify your email',
  body: `Your code: ${code}`
});

4. API Key Protection

Never expose scraping API keys in responses or logs

🚀 Deployment Options

Option 1: n8n Cloud (Easiest)

  1. Sign up at n8n.cloud
  2. Import workflow
  3. Configure credentials
  4. Activate

Pros: No maintenance, automatic updates Cons: Monthly cost

Option 2: Self-Hosted (Most Control)

# Using Docker
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

# Using npm
npm install -g n8n
n8n start

Pros: Free, full control Cons: You manage updates

Option 3: Cloud Platforms

  • Railway.app (recommended for beginners)
  • DigitalOcean App Platform
  • AWS ECS
  • Google Cloud Run

📈 Scaling Recommendations

For < 100 searches/day

  • Current setup is perfect
  • Use n8n Cloud Starter or small VPS

For 100-1000 searches/day

  • Add Redis caching (1-hour cache)
  • Use queue system for scraping
  • Upgrade to n8n Cloud Pro

For 1000+ searches/day

  • Implement job queue (Bull/Redis)
  • Use dedicated scraping service
  • Load balance multiple n8n instances
  • Consider microservices architecture

🐛 Troubleshooting

Issue: Webhook not responding

Solution:

  1. Check workflow is Active
  2. Verify webhook URL is correct
  3. Check n8n logs: Settings → Log Streaming

Issue: No prices returned

Solution:

  1. Test scraping endpoints individually
  2. Check if hotel name matches exactly
  3. Verify dates are in future
  4. Try different date ranges

Issue: Emails not sending

Solution:

  1. Verify SMTP credentials
  2. Check "less secure apps" setting (Gmail)
  3. Use App Password instead of regular password
  4. Check spam folder

Issue: Slow response times

Solution:

  1. Enable parallel scraping (already configured)
  2. Add timeout limits (30 seconds recommended)
  3. Implement caching
  4. Use faster scraping service

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 Request

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

Block 2 - Parse & Validate Request

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

Block 3 - Check If Ready

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

Block 4 - Scrape Booking.com

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 5 - Scrape Agoda

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 6 - Scrape Expedia

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 7 - Aggregate & Compare

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

Block 8 - Format Email Report

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

Block 9 - Send Email Report

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

Block 10 - Webhook Response (Success)

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

Block 11 - Webhook Response (Info)

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

Block 12 - Log Analytics

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

Block 13 - Save to Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 14 - Sticky Note

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

Block 15 - Sticky Note1

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

Block 16 - Sticky Note2

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

Block 17 - Sticky Note3

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

Block 18 - Sticky Note4

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

Block 19 - Sticky Note5

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

3. Summary Table

Workflow Automate hotel price comparison with multi-platform scraping and email reporting
Complexity advanced
Nodes 19
Categories Market Research
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/9777/9777.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 Automate hotel price comparison with multi-platform scraping and email reporting do?

This is a production ready, end to end workflow that automatically compares hotel prices across multiple booking platforms and delivers beautiful email reports to users. Unlike basic building block...

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 Market Research use case.