n8n Proxy Configuration
n8n is a workflow automation platform that connects hundreds of services and APIs. When n8n workflows make HTTP requests to external websites -- for scraping, API calls, or monitoring -- proxy infrastructure ensures reliable access without IP-based blocking.
Why n8n Workflows Need Proxies
n8n workflows that interact with external websites benefit from proxies because:
- **Web scraping nodes**: n8n's HTTP Request node and scraping workflows access websites that block automated traffic from datacenter IPs.
- **Rate limiting**: Workflows running on schedules (every minute, hourly) accumulate requests from a single IP that trigger rate limits.
- **Geo-restricted content**: Some workflows need to access content from specific geographic locations.
- **API call diversity**: Distributing API calls across multiple IPs prevents single-IP rate limiting from external services.
Configuring Proxy in n8n
#### Method 1: Global Proxy via Environment Variables
Set proxy environment variables for your n8n instance to route all HTTP traffic through Hex Proxies:
# For self-hosted n8n (add to .env or Docker environment)
HTTP_PROXY=http://user:pass@gate.hexproxies.com:8080
HTTPS_PROXY=http://user:pass@gate.hexproxies.com:8080
N8N_USE_DEPRECATED_REQUEST_LIB=falseFor Docker deployments:
services:
n8n:
image: n8nio/n8n
environment:
- HTTP_PROXY=http://user:pass@gate.hexproxies.com:8080
- HTTPS_PROXY=http://user:pass@gate.hexproxies.com:8080#### Method 2: Per-Node Proxy Configuration
For workflows where only specific nodes need proxy routing, configure the HTTP Request node directly:
- Add an **HTTP Request** node to your workflow.
- In the node settings, look for the **Options** section.
- Add a **Proxy** option with the URL: `http://user:pass@gate.hexproxies.com:8080`
- The request will route through Hex Proxies while other nodes use direct connections.
#### Method 3: Code Node with Proxy
For advanced proxy control in n8n Code nodes:
const https = require('https');// Using node-fetch or axios with proxy const response = await this.helpers.httpRequest({ method: 'GET', url: 'https://target-site.com/data', proxy: { host: 'gate.hexproxies.com', port: 8080, auth: { username: 'user-country-us', password: 'your-password' } } });
return [{ json: response }]; ```
Common n8n Proxy Use Cases
#### Price Monitoring Workflow
Schedule Trigger (hourly) → HTTP Request (with proxy) → Parse HTML → Compare Prices → Slack NotificationConfigure the HTTP Request node with Hex Proxies to reliably fetch pricing pages without being blocked.
#### SEO Rank Tracking
Schedule Trigger (daily) → HTTP Request (geo-targeted proxy) → Parse SERP → Store in Database → DashboardUse geo-targeted proxy credentials (user-country-us, user-country-gb) to check rankings from specific markets.
#### Content Monitoring
Schedule Trigger → HTTP Request (proxy) → Compare with Previous → Email Alert on ChangesMonitor competitor websites for content changes using residential proxies that maintain long-term access.
n8n Cloud vs Self-Hosted
**n8n Cloud**: Proxy configuration may be limited to the HTTP Request node options. Set the proxy URL directly in each node that needs it.
**Self-hosted n8n**: Full control via environment variables. Set global proxy for all outgoing HTTP traffic, or configure per-node for selective proxying.
Cost Considerations
n8n workflows typically make low-volume, high-frequency requests. A workflow checking 50 URLs hourly generates ~1,200 requests per day. At 100 KB per request, monthly bandwidth is approximately 3.6 GB.
Residential proxies at $4.25/GB make this very cost-effective: ~$15/month for comprehensive monitoring.