Traditional Robotic Process Automation (RPA) typically requires heavy tools and dedicated desktops. However, with the rise of low-code, there's a growing need: how to run browser automations directly in n8n?
In this article, we'll explore possible approaches, common issues with self-hosted Puppeteer, and why a managed infrastructure like Huarp is the definitive solution.
The Problem: RPA in n8n is not trivial
n8n is excellent for APIs, but when we need to interact with websites requiring JavaScript, login, or element clicks, things get complicated. The native "Execute Command" node running local Python or Node.js scripts doesn't scale.
Approach 1: Using Puppeteer in Code Node
Most developers' first attempt is trying to install Puppeteer in the n8n container and run it via Code Node.
const puppeteer = require('puppeteer');
// This usually breaks in Docker containers
// due to missing system dependencies
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://google.com');
🚫 Technical Limitations
Memory Usage: Chrome consumes significant RAM. Running it in the same container as n8n can crash your main workflows.
Dependencies: Alpine Linux containers (n8n default) lack graphic libraries needed to run Chrome.
Blocks: A "raw" Puppeteer is easily detected by any anti-bot protection (Cloudflare, etc).
The Professional Solution: Huarp
To solve this, we created Huarp: a browser automation infrastructure designed specifically for n8n.
Instead of trying to manage browsers, proxies, and detection inside your server, you use our API or our Custom Node to command remote browsers.
How does the Huarp workflow work?
- Your n8n workflow starts.
- The Huarp node requests an action (e.g., "Open page", "Click", "Extract Data").
- Our infrastructure executes this in a real browser, managed and with optimized sessions.
- The result (JSON, Text, Screenshot) returns to your workflow instantly.
✅ Huarp Advantages
Does not consume your n8n server RAM.
Comes with human click simulator and managed infrastructure.
Visual editor to build steps.
Practical Example
Imagine you need to download an invoice from a portal requiring login. With Huarp, your workflow JSON would be this simple:
{
"action": "click",
"selector": "#btn-download-invoice",
"waitForDownload": true
}