Taking screenshots in n8n with Puppeteer
On self-hosted n8n you can install the community node n8n-nodes-puppeteer, which drives headless Chrome from your workflow and has a screenshot operation. It needs a Chromium inside your n8n server or container, so it's a self-hosting job; n8n Cloud can't run a browser of your own. If you'd rather not run Chrome, an HTTP Request node calling a screenshot API does the capture; ours is $0.02 per shot.
Try it free Website Screenshot API — any page, real browser · $0.02 / call
Install the Puppeteer node
- In self-hosted n8n, open Settings > Community nodes and install n8n-nodes-puppeteer.
- Make sure a Chromium browser is available to n8n. The standard n8n Docker image doesn't include one, so follow the node's README for adding it to your image.
- Restart n8n, add the Puppeteer node to a workflow and choose the screenshot operation.
- Set the URL from an earlier node, pick full page or viewport, and the image comes out as binary data you can save or send.
Puppeteer in the Code node
If you want your own script, n8n can let the Code node load external modules. Set the environment variable NODE_FUNCTION_ALLOW_EXTERNAL=puppeteer, install puppeteer where n8n runs, and require it in the Code node. You then write the launch, goto, screenshot and close steps yourself, which also lets you log in or click before the shot.
What running Chrome inside n8n costs you
- Memory: each browser takes hundreds of MB. Several workflows capturing at once can starve n8n itself.
- Hung pages: always set a navigation timeout and close the browser in every branch, or zombie Chrome processes pile up.
- Fonts: a bare container shows squares for Chinese, Arabic or emoji until you install font packages such as Noto.
- Updates: Chromium and Puppeteer versions have to match, and both need upgrading over time.
The no-browser route
An HTTP Request node can POST {"url": "...", "full_page": true} to https://iamai.markets/api/x402/services/C1o9P1hX6xwy. The image comes back as image_base64 inside result; a Convert to File node (Move Base64 String to File) turns it into a binary file for the next node.
The catch is payment: the first answer is 402, and the HTTP Request node can't sign an x402 payment by itself. Our page on taking a website screenshot in n8n walks through that part.
Puppeteer node vs screenshot API
| Puppeteer in n8n | Screenshot API (iamai.markets) | |
|---|---|---|
| n8n Cloud | No | Yes, with an x402 payment step |
| Cost per shot | Free, you pay for the server | $0.02, failed shots free |
| Logins and clicks before the shot | Yes | No |
| Upkeep | Chromium, memory, fonts | None |
The product
Questions
Can Puppeteer log in before taking the screenshot?
Yes, that's its main advantage. Script the login in the Code node, keep the cookies, then capture. A screenshot API only sees what a logged-out visitor sees.
Why does my screenshot show squares instead of letters?
The container lacks fonts for that language. Install a font package (for example Noto fonts) in the image and restart.
Which is cheaper?
If you already run a server with spare memory, Puppeteer costs nothing per shot. If you'd need a bigger server only for Chrome, a few thousand shots a month through an API is often less.
Related
Updated 2026-12-01
