n8n community node to merge and split PDFs using the PDF API Hub
npm install n8n-nodes-pdf-split-mergePDF Split & Merge for n8n using the PDF API Hub.
This package adds a node that can:
- Merge multiple PDF URLs into a single PDF
- Split a PDF with a configurable mode (e.g., "each")
Authentication and base URL: the CLIENT-API-KEY is sent as a header to https://pdfapihub.com/api/v1.
> [!TIP]
> New to building n8n nodes? The fastest way to get started is with npm create @n8n/node. This command scaffolds a complete node package for you using the @n8n/node-cli.
To create a new node package from scratch:
``bash`
npm create @n8n/node
Develop locally:
`bash`
npm run dev
This starts n8n with your nodes loaded and hot reload enabled.
Create a credential of type "PDF API Hub" and set your API key. The node sends:
- Header: CLIENT-API-KEY: application/json
- Content-Type:
> [!TIP]
> The declarative/low-code style (used in GitHub Issues) is the recommended approach for building nodes that interact with HTTP APIs. It significantly reduces boilerplate code and handles requests automatically.
Browse these examples to understand both approaches, then modify them or create your own.
The node exposes two operations:
- Merge PDF
- Endpoint: POST https://pdfapihub.com/api/v1/pdf/mergeURLs
- Parameters:
- (array of strings) — list of PDF URLs to mergeOutput Format
- (url/file) — return URL or download filePOST https://pdfapihub.com/api/v1/pdf/split
- Returns: merged PDF URL or file
- Split PDF
- Endpoint: PDF URL
- Parameters:
- (string) — the PDF to splitSplit Type
- (pages/each/chunks) — how to split the PDFPages
- (string) — specific pages to extract (e.g., "1-3,5")Number of Chunks
- (number) — number of chunks to split intoOutput Format
- (url/file) — return URLs or download files/ZIP
- Returns: split PDF URLs or files
These are excellent resources to understand how to structure your nodes, handle different API patterns, and implement advanced features.
Before you begin, install the following on your development machine:
- Node.js (v22 or higher) and npm
- Linux/Mac/WSL: Install via nvm
- Windows: Follow Microsoft's NodeJS guide
- git
- Follow n8n's development environment setup guide
> [!NOTE]
> The @n8n/node-cli is included as a dev dependency and will be installed automatically when you run npm install. The CLI includes n8n for local development, so you don't need to install n8n globally.
Follow these steps to create your own n8n community node package:
Generate a new repository from this template, then clone it:
`bash`
git clone https://github.com/
cd
`bash`
npm install
This installs all required dependencies including the @n8n/node-cli.
Start n8n with your node loaded:
`bash`
npm run dev
This command runs n8n-node dev which:
- Builds your node with watch mode
- Starts n8n with your node available
- Automatically rebuilds when you make changes
- Opens n8n in your browser (usually http://localhost:5678)
You can now test your node in n8n workflows!
> [!NOTE]
> Learn more about CLI commands in the @n8n/node-cli documentation.
Check for errors:
`bash`
npm run lint
Auto-fix issues when possible:
`bash`
npm run lint:fix
When ready to publish:
`bash`
npm run build
This compiles your TypeScript code to the dist/ folder.
Before publishing:
1. Update documentation: Replace this README with your node's documentation. Use README_TEMPLATE.md as a starting point.
2. Update the LICENSE: Add your details to the LICENSE file.
3. Test thoroughly: Ensure your node works in different scenarios.
Publish your package to make it available to the n8n community:
`bash`
npm publish
Learn more about publishing to npm.
Get your node verified for n8n Cloud:
1. Ensure your node meets the requirements:
- Uses MIT license ✅ (included in this starter)
- No external package dependencies
- Follows n8n's design guidelines
- Passes quality and security review
2. Submit through the n8n Creator Portal
Benefits of verification:
- Available directly in n8n Cloud
- Discoverable in the n8n nodes panel
- Verified badge for quality assurance
- Increased visibility in the n8n community
This starter includes several npm scripts to streamline development:
| Script | Description |
| --------------------- | ---------------------------------------------------------------- |
| npm run dev | Start n8n with your node and watch for changes (runs n8n-node dev) |npm run build
| | Compile TypeScript to JavaScript for production (runs n8n-node build) |npm run build:watch
| | Build in watch mode (auto-rebuild on changes) |npm run lint
| | Check your code for errors and style issues (runs n8n-node lint) |npm run lint:fix
| | Automatically fix linting issues when possible (runs n8n-node lint --fix) |npm run release
| | Create a new release (runs n8n-node release) |
> [!TIP]
> These scripts use the @n8n/node-cli under the hood. You can also run CLI commands directly, e.g., npx n8n-node dev.
1. Make sure you ran npm install to install dependenciespackage.json
2. Check that your node is listed in under n8n.nodesnpm run dev
3. Restart the dev server with
4. Check the console for any error messages
Run npm run lint:fix to automatically fix most common issues. For remaining errors, check the n8n node development guidelines.
Make sure you're using Node.js v22 or higher and have run npm install` to get all type definitions.
- n8n Node Documentation - Complete guide to building nodes
- n8n Community Forum - Get help and share your nodes
- @n8n/node-cli Documentation - CLI tool reference
- n8n Creator Portal - Submit your node for verification
- Submit Community Nodes Guide - Verification requirements and process
Have suggestions for improving this starter? Open an issue or submit a pull request!