Package Information
Documentation
n8n-nodes-agentgen
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
Installation (after n8n approval)
Once the package is listed in the n8n community registry, install it directly from the n8n UI:
- Open n8n → Settings → Community Nodes
- Click Install a community node
- Enter
n8n-nodes-agentgenand 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 publishfrom then8n/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
- In n8n, open Credentials → Add Credential
- Search for AgentGen API
- Paste your API key (get one at agent-gen.com)
- Click Test credential — n8n will call
/v1/balanceto confirm the key works - Save
2. Add the AgentGen node to a workflow
- Open a workflow (or create a new one)
- Click the + button to add a node
- Search for AgentGen — select it
- In the node panel, pick your Operation from the dropdown
Walkthrough: Generate an image from HTML
- Add an AgentGen node
- Set Operation →
Generate Image - 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> - (Optional) expand Image Options to set width, height, or format
- Select your AgentGen API credential
- Click Test step — the output will contain a
urlfield with a direct link to the rendered PNG
Walkthrough: Generate a PDF from HTML
- Add an AgentGen node, set Operation →
Generate PDF - PDF Mode →
Single Page - Enter your HTML in the HTML field
- (Optional) expand PDF Options to set paper size, margins, or landscape mode
- Run the node — output contains
url(the PDF link) andpages(page count)
Multi-page PDF:
- Set PDF Mode →
Multi-Page - 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" } ] - 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.
- Add an HTTP Request node (or Read Binary File) before AgentGen to load your file into the workflow as binary data
- Add an AgentGen node, set Operation →
Upload Temp File - Set Input Binary Field to the name of the binary property from the previous node (usually
data) - Run the node — the output contains a
urlvalid for 24 hours - Use that URL in an
<img src="...">tag in a subsequent Generate Image or Generate PDF node
Walkthrough: Check your token balance
- Add an AgentGen node, set Operation →
Get Balance - 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