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

v0.1.9

Published

n8n community node for AgentGen — HTML to PDF and Image generation

Readme

n8n-nodes-agentgen

npm version

This is an n8n community node for AgentGen — an HTML → PDF and HTML → Image generation service built for AI agents and developers.

Send an HTML string, get back a publicly accessible URL pointing to a rendered PDF or image.

n8n is a fair-code licensed workflow automation platform.


Demo

Watch the demo


Installation (after n8n approval)

Once the package is listed in the n8n community registry, install it directly from the n8n UI:

  1. Open n8n → SettingsCommunity Nodes
  2. Click Install a community node
  3. Enter n8n-nodes-agentgen and click Install

Manual installation (before approval)

The node can be installed manually on any self-hosted n8n instance right now, without waiting for n8n's approval process. n8n Cloud does not support manual community node installation.

Option A — Install from npm (recommended)

Requires the package to be published to npm first (npm publish from the n8n/ directory).

Step 1 — Locate your n8n data directory

This is the folder n8n uses for custom nodes. Default locations:

| How you run n8n | Default path | |-----------------|--------------| | npm global | ~/.n8n | | Docker | the volume mounted to /home/node/.n8n | | n8n desktop | ~/.n8n |

Step 2 — Install the package

cd ~/.n8n          # or your custom data directory
npm install n8n-nodes-agentgen

Step 3 — Restart n8n

# npm
n8n start

# Docker
docker restart <your-n8n-container>

Step 4 — Verify — Open n8n, add a new node, and search for AgentGen. It should appear under the Community section.


Option B — Install from a local build (no npm publish needed)

Use this during development or to share the node privately.

Step 1 — Build and pack

cd n8n
npm run build
npm pack
# Produces: n8n-nodes-agentgen-0.1.0.tgz

Step 2 — Install the tarball into n8n

cd ~/.n8n          # your n8n data directory
npm install /path/to/n8n-nodes-agentgen-0.1.0.tgz

Step 3 — Restart n8n (same as Option A, Step 3)


Using the node in a workflow

1. Set up your credential

  1. In n8n, open CredentialsAdd Credential
  2. Search for AgentGen API
  3. Paste your API key (get one at agent-gen.com)
  4. Click Test credential — n8n will call /v1/balance to confirm the key works
  5. Save

2. Add the AgentGen node to a workflow

  1. Open a workflow (or create a new one)
  2. Click the + button to add a node
  3. Search for AgentGen — select it
  4. In the node panel, pick your Operation from the dropdown

Walkthrough: Generate an image from HTML

  1. Add an AgentGen node
  2. Set OperationGenerate Image
  3. In the HTML field, enter your markup:
    <div style="font-family:sans-serif;padding:40px;background:#6C47FF;color:white;border-radius:12px">
      <h1>Hello from AgentGen 👋</h1>
      <p>Rendered by n8n</p>
    </div>
  4. (Optional) expand Image Options to set width, height, or format
  5. Select your AgentGen API credential
  6. Click Test step — the output will contain a url field with a direct link to the rendered PNG

Walkthrough: Generate a PDF from HTML

  1. Add an AgentGen node, set OperationGenerate PDF
  2. PDF ModeSingle Page
  3. Enter your HTML in the HTML field
  4. (Optional) expand PDF Options to set paper size, margins, or landscape mode
  5. Run the node — output contains url (the PDF link) and pages (page count)

Multi-page PDF:

  1. Set PDF ModeMulti-Page
  2. In the Pages (JSON) field, provide an array:
    [
      { "html": "<h1 style='font-family:sans-serif'>Cover Page</h1>", "format": "A4" },
      { "html": "<p style='font-family:sans-serif'>Page two content</p>", "format": "A4" }
    ]
  3. Run — you get a single PDF with one page per array element

Walkthrough: Upload a temp file for use in HTML

Use this when your HTML needs to reference a local image or font.

  1. Add an HTTP Request node (or Read Binary File) before AgentGen to load your file into the workflow as binary data
  2. Add an AgentGen node, set OperationUpload Temp File
  3. Set Input Binary Field to the name of the binary property from the previous node (usually data)
  4. Run the node — the output contains a url valid for 24 hours
  5. Use that URL in an <img src="..."> tag in a subsequent Generate Image or Generate PDF node

Walkthrough: Check your token balance

  1. Add an AgentGen node, set OperationGet Balance
  2. Run — output: { "tokens": 42 }

Operations

| Operation | Description | Token cost | |-----------|-------------|------------| | Generate Image | Render HTML → PNG / JPEG / WebP screenshot | 1 token | | Generate PDF | Render HTML → PDF (single or multi-page) | 2 tokens / page | | Upload Temp File | Upload an asset for use inside HTML templates | Free | | Get Balance | Check current token balance | Free |

Generate Image

Renders an HTML string to an image file.

| Parameter | Required | Default | Description | |-----------|----------|---------|-------------| | HTML | ✅ | — | HTML content to render (max 500 KB) | | Width | — | 1200 | Viewport width in px (1–5000) | | Height | — | 630 | Viewport height in px (1–5000) | | Format | — | png | Output format: png, jpeg, or webp | | Device Scale Factor | — | 2 | Pixel ratio (1–3). 2 = retina-quality |

Output: { url, width, height, format, tokens_used, request_id }

Generate PDF — Single Page

| Parameter | Required | Default | Description | |-----------|----------|---------|-------------| | HTML | ✅ | — | HTML content (max 500 KB) | | Format | — | A4 | Paper size: A4, A3, Letter, Legal | | Landscape | — | false | Landscape orientation | | Margin Top/Bottom/Left/Right | — | — | CSS lengths e.g. 20mm, 1in | | Print Background | — | true | Render CSS backgrounds |

Generate PDF — Multi-Page

Accepts a JSON array of page objects. Each page can have its own layout:

[
  { "html": "<h1>Cover</h1>", "format": "A4" },
  { "html": "<p>Content</p>", "format": "A4", "landscape": true }
]

Output: { url, pages, tokens_used, request_id }

Upload Temp File

Uploads a binary file from the workflow for use inside HTML <img src="..."> or CSS references. Files are publicly accessible for 24 hours, then auto-deleted.

Connect any node that produces binary data (e.g. HTTP Request, Read Binary File) before this node, then set the Input Binary Field to the binary property name.

Output: { url, key, size, expires_in, expires_at }

Get Balance

Returns the token balance for your API key.

Output: { tokens: number }


Credentials

Add an AgentGen API credential and paste your API key. Get one at agent-gen.com.

n8n will automatically test the credential against the /v1/balance endpoint when you click Test credential.


Compatibility

  • n8n ≥ 1.0.0
  • Tested against n8n-workflow 2.x

Resources


License

MIT