Skip to main content
All posts
split n8n Zapier automation PDF API

Automate Payslip and Statement Splitting with n8n and Zapier

Split a payslip or statement run into one PDF per person, automatically: step-by-step n8n and Zapier workflows using the PodPDF split API.

PodPDF Team September 13, 2026 6 min read

Payroll and billing systems love to produce one enormous PDF: every payslip for the month, every customer statement for the quarter, one after another. Somebody then has to cut it into individual files and send each one to the right person. In print shops this is called bursting, and it is exactly the kind of job to hand to an automation.

This guide shows how to burst a PDF run with the PodPDF split API, first in n8n and then in Zapier.

The Pattern

Most runs have a fixed number of pages per person — one page per payslip, two per statement — so the split is simple:

  • One page each: {"mode": "each_page"}
  • N pages each: {"mode": "every_n", "every_n": 2}
  • Uneven lengths: {"mode": "ranges", "ranges": ["1-2", "3-5", "6-6"]}, if your system tells you where each document starts

The output files come back in order, so file number k belongs to the k-th person in the export your payroll or billing system already gives you. Joining the two lists is the whole trick.

Name the files so they’re easy to trace with options.filename_pattern, for example payslip-{index:03} gives payslip-001.pdf, payslip-002.pdf.

Size Matters: Instant or Queued

A run of up to 4 MB and 100 people can be split with a single request to POST /pdf/split. Larger runs — anything up to 150 MB, 5000 pages and 500 files — go through an upload and a background job. Payslip runs for a company of a few hundred people usually need the job flow, so both are shown below.

A note on size: payslips and statements share a letterhead, logo and fonts. Every output file needs its own copy of those, so 300 split payslips can be larger in total than the original run. That’s expected.

n8n

You need an n8n instance and a PodPDF API key stored as a Header Auth credential with the header name X-API-Key (see using the PodPDF API in n8n for setup).

Small runs: one HTTP Request node

  1. Trigger — whatever delivers the run: an email attachment, a new file in Google Drive, a scheduled download from your payroll system. Make sure the PDF is available as binary data (usually the data property).
  2. HTTP Request node:
    • Method: POST
    • URL: https://api.podpdf.com/pdf/split
    • Authentication: your Header Auth credential
    • Send Body: on, Body Content Type: Form-Data
    • Parameter file of type n8n Binary File, input data field data
    • Parameter split of type Form Data, value {"mode": "each_page"}
    • Parameter options of type Form Data, value {"filename_pattern": "payslip-{index:03}"}
  3. Split Out node on the outputs field, so each output becomes its own item.
  4. HTTP Request node that downloads {{ $json.download_url }} with Response Format set to File.
  5. Merge node (combine by position) with the employee list from your payroll export, then Gmail or Outlook to send each person their file.

Large runs: upload, queue, wait

Replace step 2 with four nodes:

  1. HTTP RequestPOST https://api.podpdf.com/pdf/upload-url with JSON body {"content_length_bytes": {{ $binary.data.fileSize }}}. Depending on your n8n version the size may be a string such as “3.2 MB”; if so, add a Code node that reads the buffer length first.
  2. HTTP RequestPUT to {{ $json.upload_url }}, body n8n Binary File, header Content-Type: application/pdf, no authentication (the URL is already signed, and sending your API key to storage would be refused).
  3. HTTP RequestPOST https://api.podpdf.com/pdf/jobs with JSON body:
{
  "operation": "split",
  "inputs": [{ "s3_key": "{{ $('Upload URL').item.json.s3_key }}", "filename": "payslips.pdf" }],
  "split": { "mode": "each_page" },
  "options": { "filename_pattern": "payslip-{index:03}" }
}
  1. Wait for the job. Either loop a GET /jobs/{{ $json.job_id }} request with a Wait node until status is completed, or — better — register a webhook for job.completed in PodPDF and start a second workflow from a Webhook trigger. The webhook payload includes job_type: "pdfop", output_count and files_url.

Then call GET /jobs/{job_id}/files and continue from step 3 of the small-run workflow, downloading each file with GET /jobs/{job_id}/files/{index}/download.

Zapier

Zapier’s Webhooks by Zapier → Custom Request step sends JSON, which works well with the base64 form of the split API for runs up to about 4 MB. You’ll need a Zapier plan that includes Webhooks by Zapier (see using the PodPDF API in Zapier).

  1. Trigger — for example New Attachment in Gmail or New File in Folder in Google Drive.
  2. Code by Zapier (JavaScript) — fetch the file and base64-encode it:
const response = await fetch(inputData.fileUrl);
const buffer = Buffer.from(await response.arrayBuffer());
return { pdf_base64: buffer.toString('base64'), size: buffer.length };
  1. Webhooks by Zapier → Custom Request:
    • Method: POST, URL: https://api.podpdf.com/pdf/split
    • Headers: X-API-Key: YOUR_API_KEY, Content-Type: application/json
    • Data:
{
  "input": { "pdf_base64": "{{pdf_base64}}", "filename": "statements.pdf" },
  "split": { "mode": "every_n", "every_n": 2 },
  "options": { "filename_pattern": "statement-{index:03}" }
}
  1. Looping by Zapier over outputs, then send each download_url as an attachment with Gmail or save it to Google Drive. Download links are valid for an hour, so keep the send in the same Zap run.

For runs larger than the instant limit, Zapier needs the same upload–job–webhook flow as n8n. The upload step has to send raw bytes, which is easiest from a Code by Zapier step with fetch(upload_url, { method: 'PUT', body: buffer, headers: { 'Content-Type': 'application/pdf' } }). Then catch the job.completed webhook with Webhooks by Zapier → Catch Hook in a second Zap.

Checks Worth Adding

  • Page count sanity check. Before splitting, call POST /pdf/inspect (free) and compare page_count with employees × pages per payslip. If they don’t match, stop and alert someone instead of sending payslips to the wrong people.
  • Encrypted exports. Some payroll systems protect PDFs by default. A protected file is refused with PDF_ENCRYPTED; switch the export setting off rather than working around it.
  • Concurrency. Up to 2 merge or split jobs can run at once per account. If you burst several runs in parallel, a third job gets PDF_JOB_ALREADY_ACTIVE — retry it after a short wait.
  • Keep the originals. Output files are kept for 7 days. Store the files you send somewhere permanent if you need them later.

Get Started

Start generating PDFs today

$0.01 per PDF — no subscriptions, no monthly minimums. Credits never expire.