Run Custom Script
AI-generatedSummary
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$puppeteerfor 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_ENDPOINTandBROWSER_WS_TOKENenvironment 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
$jsondata. With download capture enabled, captured files are attached as binary properties (datafor one file, or indexeddata0,data1, etc. when multiple files are assigned to an item). Errors are thrown unless the node is configured to continue on fail.