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
Option 1: n8n Community Nodes (Recommended)
- Navigate to Settings → Community Nodes in your n8n instance.
- Click Install a community node.
- Enter package name:
n8n-nodes-headlessx - Click Install and wait for completion.
- Restart n8n if required.
Option 2: Manual Installation
⚙️ Configuration
Configure Credentials:
- Create a new HeadlessX API credential in n8n.
- Base API URL:
http://localhost:8000/(or your hosted URL) - API Token: Your HeadlessX API token
Test Connection:
- Add the HeadlessX node to your workflow.
- 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
-
Schedule Trigger
- Run every 1 hour
-
HTTP Request
-
Compare with Previous
- Use Function node to compare HTML
-
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:
- Scrape HTML
- Scrape with JS
- Get Content
- Take Screenshot
- 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
- Use Batching: Don't scrape 1000 URLs at once
- Add Delays: Respect target servers
- Error Handling: Always handle failures
- Logging: Use N8N's built-in logging
- Credentials: Store API keys in N8N credentials