Docs
Integrations
N8N Integration

N8N Integration

Complete guide to integrating HeadlessX with N8N workflows

by saifyxpro

Integrate HeadlessX into your N8N workflows for powerful, undetectable web scraping automation.

🎯 Installation Options


  1. Navigate to Settings → Community Nodes in your n8n instance.
  2. Click Install a community node.
  3. Enter package name: n8n-nodes-headlessx
  4. Click Install and wait for completion.
  5. Restart n8n if required.

Option 2: Manual Installation

⚙️ Configuration


Configure Credentials:

  1. Create a new HeadlessX API credential in n8n.
  2. Base API URL: http://localhost:8000/ (or your hosted URL)
  3. API Token: Your HeadlessX API token

Test Connection:

  1. Add the HeadlessX node to your workflow.
  2. Select any operation and test.

Complete Workflow Examples


Example 1: Scrape Product List

Workflow: Trigger → HTTP Request → Parse JSON → Store in Database

Example 2: Monitor Website Changes

Workflow: Schedule → Scrape → Compare → Send Alert

  1. Schedule Trigger

    • Run every 1 hour
  2. HTTP Request

  3. Compare with Previous

    • Use Function node to compare HTML
  4. Send Notification

    • Email/Slack if changes detected

Example 3: Bulk URL Scraping

Workflow: Spreadsheet → Split → Scrape → Aggregate

HeadlessX N8N Node (Custom)


Installation

Install the custom HeadlessX node for simplified integration:

Restart N8N to load the custom node.

Node Configuration

The custom node provides a cleaner interface:

Credentials:

  • API URL: http://localhost:8000
  • API Key: your-api-key

Operations:

  1. Scrape HTML
  2. Scrape with JS
  3. Get Content
  4. Take Screenshot
  5. Google Search

Fields:

  • URL (required)
  • Stealth Mode (toggle)
  • Timeout (ms)
  • Proxy (optional)
  • Wait For (load/networkidle)

Example Usage

Advanced Patterns


Pattern 1: Retry on Failure

Use Error Trigger to retry failed scrapes:

Pattern 2: Parallel Scraping

Scrape multiple URLs concurrently:

Pattern 3: AI Content Extraction

Combine with OpenAI for intelligent data extraction:

Common Use Cases


E-commerce Monitoring

Monitor competitor prices:

  • Trigger: Schedule (daily)
  • Scrape: Product pages
  • Extract: Price, stock
  • Store: Database
  • Alert: If price changed

Content Aggregation

Aggregate blog posts:

  • Trigger: RSS feed
  • Scrape: Full articles
  • Convert: To markdown
  • AI: Summarize
  • Publish: To your site

Lead Generation

Extract contact information:

  • Trigger: New company added
  • Scrape: Company website
  • Extract: Email, phone
  • Enrich: With AI
  • Add: To CRM

Troubleshooting


Connection Refused

Ensure HeadlessX is accessible from N8N:

Timeout Errors

Increase timeout in HTTP Request node:

  • Timeout: 120000 (2 minutes)

Authentication Errors

Verify API key:

  • Dashboard → Settings → API Keys
  • Copy exact key without spaces

Best Practices


  1. Use Batching: Don't scrape 1000 URLs at once
  2. Add Delays: Respect target servers
  3. Error Handling: Always handle failures
  4. Logging: Use N8N's built-in logging
  5. Credentials: Store API keys in N8N credentials

Next Steps