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-api

v0.1.6

Published

n8n community node for remote browser automation using Playwright over WebSocket

Readme

n8n-nodes-playwright-api

An n8n community node for remote browser automation using Playwright over WebSocket.

Unlike other n8n Playwright nodes that run browsers locally (requiring ~1GB of browser binaries), this node connects to a remote Playwright server — ideal for Kubernetes, Docker, and cloud environments where n8n and the browser engine run on separate containers/machines.

How It Works

┌─────────────┐     WebSocket      ┌──────────────────────┐
│   n8n        │ ◄──────────────► │  Playwright Server    │
│  (this node) │   connect()       │  (Docker container)   │
└─────────────┘                    └──────────────────────┘

This node uses Playwright's native browserType.connect(wsEndpoint) to connect to a remote Playwright server over WebSocket. The connection uses the full Playwright protocol, supporting all browsers (Chromium, Firefox, WebKit) with full feature fidelity.

Prerequisites

  • A running Playwright server accessible via WebSocket
  • Important: The Playwright version on the server must match the client version (currently 1.49.0)

Recommended: Microsoft Playwright Docker Image

docker run --rm -p 3000:3000 mcr.microsoft.com/playwright:v1.58.0-noble \
  npx playwright launch-server --browser chromium --host 0.0.0.0 --port 3000

Installation

In n8n (Community Node)

  1. Go to Settings > Community Nodes
  2. Install: n8n-nodes-playwright-api

Manual Installation

cd ~/.n8n/custom
pnpm install n8n-nodes-playwright-api

Note: Set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 in your environment to skip browser binary downloads — this node only needs the Playwright client library, not the browser binaries.

Configuration

Credentials

Create a Playwright API credential in n8n with:

| Field | Description | Example | |---|---|---| | WebSocket Endpoint | The WS URL of your Playwright server | ws://playwright-server:3000 | | Browser Type | Chromium, Firefox, or WebKit | chromium | | Timeout (ms) | Connection timeout | 30000 | | Slow Mo (ms) | Delay between operations (for debugging) | 0 | | Headers | Optional auth headers for the WS connection | Authorization: Bearer token |

Operations

| Operation | Description | |---|---| | Navigate | Go to a URL and retrieve page content | | Take Screenshot | Capture full page or viewport screenshots | | Get Text | Extract text using CSS selectors or XPath | | Click Element | Click on an element | | Fill Form | Populate form fields | | Run Custom Script | Execute custom JavaScript with full Playwright API access |

Custom Script Variables

In the Run Custom Script operation, these variables are available:

  • $page — Current Playwright Page instance
  • $browser — Browser instance
  • $playwright — Playwright library
  • $helpers — n8n helper methods (including prepareBinaryData)
  • $json, $input — Standard n8n variables

Docker Compose Example

See docker-compose.yml for a complete setup with n8n and a Playwright server.

services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    depends_on:
      - playwright-server

  playwright-server:
    image: mcr.microsoft.com/playwright:v1.58.0-noble
    command: npx playwright launch-server --browser chromium --host 0.0.0.0 --port 3000
    ports:
      - "3000:3000"

Then configure your Playwright API credentials with ws://playwright-server:3000.

Kubernetes Deployment

Example Kubernetes manifests for running the Playwright server as a separate service:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: playwright-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: playwright-server
  template:
    metadata:
      labels:
        app: playwright-server
    spec:
      containers:
        - name: playwright
          image: mcr.microsoft.com/playwright:v1.58.0-noble
          command: ["npx", "playwright", "launch-server", "--browser", "chromium", "--host", "0.0.0.0", "--port", "3000"]
          ports:
            - containerPort: 3000
          resources:
            requests:
              memory: "512Mi"
              cpu: "500m"
            limits:
              memory: "2Gi"
              cpu: "2000m"
---
apiVersion: v1
kind: Service
metadata:
  name: playwright-server
spec:
  selector:
    app: playwright-server
  ports:
    - port: 3000
      targetPort: 3000

Then configure your n8n Playwright API credentials with ws://playwright-server:3000.

Version Compatibility

| This Node | Playwright Server | |---|---| | 0.1.x | v1.58.x |

The Playwright client and server major.minor versions must match. If you upgrade the Playwright dependency in this node, you must also update your Playwright server image.

Development

# Clone the repo
git clone <repo-url>
cd n8n-nodes-playwright-api

# Install dependencies (skips browser download)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pnpm install

# Build
pnpm build

# Link to n8n for development
cd ~/.n8n/custom
pnpm link <path-to-this-repo>

License

MIT

Credits

Based on n8n-nodes-playwright by Mohamed Toema, modified for remote browser execution.