Puppeteer Enhanced (HTML to Image) icon

Puppeteer Enhanced (HTML to Image)

Automate browser interactions using Puppeteer (Enhanced fork with improved browserWSEndpoint)

Run Custom Script

AI-generated

Summary

Execute JavaScript for each incoming item in a Puppeteer page, using it to navigate, interact with pages, and produce workflow data. Return an array of items from the script; optionally capture downloads as binary output.

Inputs

  • Script Code (required) — JavaScript run once per input item. Use $page, $browser, or $puppeteer for Puppeteer operations, and n8n workflow variables and helpers available in the script context. The script must return an array of items, such as [{ result: value }]; a non-array return causes an error.
  • Options — Configure browser execution and page behavior: batch size, remote browser WebSocket endpoint or local executable path, device emulation, extra HTTP headers, launch arguments, protocol timeout, page caching, headless or headless shell mode, stealth mode, human typing mode and its delay/typo settings, proxy server, and container launch arguments. Enable Capture Downloads to attach detected downloads as binary data. Navigation timeout and Wait Until do not apply to this operation. Browser configuration may also use the BROWSER_WS_ENDPOINT and BROWSER_WS_TOKEN environment variables.

Output shape

A list of items returned by the script, normalized for n8n; optionally items include binary download data.

The script runs separately for each input item, and can use that item's $json data. With download capture enabled, captured files are attached as binary properties (data for one file, or indexed data0, data1, etc. when multiple files are assigned to an item). Errors are thrown unless the node is configured to continue on fail.

Links

Discussion