npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-playwright-automation

v0.5.1

Published

Community Playwright integration for n8n. Run reliable headless browser automations (scraping, form filling, login flows, PDF/screenshots, E2E checks) powered by Playwright — directly inside n8n workflows.

Readme


🚀 Features

This node allows you to control a headless browser to automate complex web tasks.

Session

| Operation | Description | |-----------|-------------| | Create | Start a new browser session (Chromium/Firefox/WebKit) | | Close | Close an active session | | Get Storage State | Retrieve cookies and storage state (e.g., to save and reuse login sessions) |

Page Interaction

| Operation | Description | |-----------|-------------| | Navigate | Go to a specific URL | | Click | Click elements using smart selectors | | Type/Fill | Fill forms and input fields | | Wait | Wait for a specific duration or for elements to appear | | Get Text/HTML/Attribute | Extract data from the page | | Count Elements | Count occurrences of an element | | Upload File | Upload files to input fields |

Capture

| Operation | Description | |-----------|-------------| | Screenshot | Capture visible page or full page screenshots | | PDF | Generate a PDF of the current page |

Script (Advanced)

| Operation | Description | |-----------|-------------| | Run Script | Execute custom JavaScript code with full Playwright API access |


📜 Custom Script Feature

For advanced automation scenarios where predefined operations aren't sufficient, you can run custom Playwright scripts.

How It Works

The Script → Run Script operation allows you to write JavaScript code that has direct access to:

Example Usage

// Get page information
const title = await page.title();
const url = page.url();

// Interact with elements
await page.click('button.submit');
await page.fill('#email', '[email protected]');

// Wait for network requests
await page.waitForResponse(resp => resp.url().includes('/api/'));

// Extract data
const items = await page.$$eval('.product', els => 
  els.map(el => ({
    name: el.querySelector('.name').textContent,
    price: el.querySelector('.price').textContent
  }))
);

// Return data to the n8n workflow
return { title, url, items };

Output

The script's return value is included in the node output:

{
  "success": true,
  "action": "runScript",
  "returnValue": {
    "title": "Example Shop",
    "url": "https://example.com/products",
    "items": [ ]
  },
  "executionTimeMs": 142
}

[!TIP] Use custom scripts for complex scenarios like multi-step login flows, infinite scroll handling, or interacting with dynamic SPAs.


📦 Installation

n8n Community Nodes

  1. Go to SettingsCommunity Nodes
  2. Select Install
  3. Enter n8n-nodes-playwright-automation
  4. Agree to the risks and select Install

The node will automatically download the required browser binaries the first time you execute it.

[!IMPORTANT] Linux Users (Docker/Self-hosted):

We strongly recommend using our Docker setup to avoid any issues. It uses the official Playwright image which comes pre-loaded with all required system libraries and browsers.

If you choose to use a different or custom n8n image, you MUST ensure your environment has all Playwright system dependencies installed (e.g., libnspr4, libnss3, libgbm1). The node will not work without these libraries.

Using custom Docker image? We strongly recommend basing your image on the official Playwright image:

FROM mcr.microsoft.com/playwright:v1.58.0-noble

Manual Installation

If you prefer to install manually:

cd ~/.n8n/nodes
npm install n8n-nodes-playwright-automation

🐳 Docker Support

[!TIP] Why use our Docker setup?

Our Docker image is pre-configured with all the necessary system dependencies and libraries required for Playwright to run correctly.

If you use a different n8n image, you will likely run into issues unless you manually install all the required libraries for headless browsers.

To run this node in Docker, we provide a docker-compose.yml file that:

  1. Installs all required Playwright browser dependencies
  2. Mounts the built node code into n8n
  3. Persists n8n data

Quick Start (Development Mode)

This project includes a Docker setup optimized for development, running npm run dev inside a Node.js container with all Playwright dependencies pre-installed.

  1. Start the Development Container: Using Docker directly:

    docker compose up -d --build

    Alternative (Shorthand):

    npm run dev:docker

    This will build the image, install dependencies, and start n8n in development watch mode.

  2. Access n8n: Open http://localhost:5678 in your browser.

  3. Development: The source code is mounted into the container. Changes to the code will automatically trigger a rebuild/restart of the node (handled by n8n-node dev).

Configuration

The provided docker-compose.yml uses a custom Dockerfile based on the official Playwright Docker image (mcr.microsoft.com/playwright:v1.58.0-noble). This ensures Node.js 22, all system dependencies, and required browsers are pre-installed and optimized.


🛠️ Development

Prerequisites

Getting Started

# Clone the repository
git clone https://github.com/shhadi/n8n-nodes-playwright-automation.git
cd n8n-nodes-playwright-automation

# Install dependencies
npm install

# Start development server
npm run dev

Available Scripts

| Script | Description | |--------|-------------| | npm run dev | Start n8n with your node and watch for changes | | npm run build | Compile TypeScript to JavaScript for production | | npm run lint | Check your code for errors and style issues | | npm run lint:fix | Automatically fix linting issues when possible |


🤝 Contributing

Contributions are welcome! We'd love to have you help improve this project.

Please read our Contributing Guidelines to get started. This guide includes:

  • Development setup instructions
  • How to submit pull requests
  • Coding standards and best practices
  • Reporting issues

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


✨ Contributors


👨‍💻 Maintainer