Skip to main content

How Do You Create a ZUGFeRD Invoice in n8n? A Dropbox + JSON Workflow, Step by Step!

· 11 min read
SEO and Content Writer

This guide builds an n8n workflow that takes invoice data as JSON, creates a ZUGFeRD/Factur‑X invoice with PDF4me, and uploads the final PDF to Dropbox.

You will wire three core parts:

  1. push invoice JSON into PDF4me (so you get a stable document URL),
  2. generate the ZUGFeRD invoice from that input,
  3. upload the output PDF to Dropbox as a binary file.
The short version

1. Trigger (Execute workflow) → 2. PDF4me: Upload JSON file → 3. PDF4me: Create Zugferd Invoice (JSON, URL input) → 4. Dropbox: Upload a file (binary data).

Remember this before you run step 2

Keep one consistent binary field name end-to-end (this walkthrough uses data). Also, if you choose Invoice Data Input Type = URL, the JSON must be reachable from the link you pass (that is why we upload JSON to PDF4me first).

What you will get!

Input: invoice JSON data.
Output: a generated ZUGFeRD/Factur‑X PDF (PDF with embedded invoice XML) uploaded to a Dropbox path such as /blog data/zugferd invoice/output/Zugferd_Result.pdf.


At a glance: the workflow steps

1Trigger
2Upload JSON
3Create invoice
4Upload to Dropbox

Before you start (checklist!)

Checklist
  • n8n (cloud or self-hosted) and permission to create a workflow.
  • PDF4me credentials (API key) configured in n8n. See Connect PDF4me to n8n.
  • Dropbox OAuth2 credential in n8n with access to your output folder.
  • A valid invoice JSON payload (start with a known-good sample, then replace fields gradually).

Workflow overview

n8n canvas: Execute workflow trigger, PDF4me Upload JSON file to PDF4me, PDF4me Create Zugferd invoice, Dropbox Upload a file

Four nodes in sequence: trigger → upload JSON → generate ZUGFeRD invoice → upload PDF to Dropbox.


Step 1: Trigger (Execute workflow)

Workflow so far: just the trigger.

  1. Create a new workflow in n8n.
  2. Use When clicking “Execute workflow” while you build the first version.
  3. Later, swap this to Cron, Webhook, or a “new file” trigger when the workflow is stable.

Step 2: Upload JSON file to PDF4me

This step turns your JSON into a PDF4me-hosted document, so you can pass a document URL to the invoice generation node.

  1. Add PDF4me node.
  2. Resource: PDF4me.
  3. Operation: Upload File To PDF4me.
  4. Input Data Type: choose the same type you are actually providing (the screenshot uses a base64 string).
  5. Set File Retention Hours to your preferred window (example shown: 2 hours).
  6. Execute the node once and confirm it outputs a usable URL/token you can reference in the next node.
n8n PDF4me node Upload File To PDF4me with Input Data Type Base64 String and File Retention Hours

Step 2 screenshot: upload JSON so PDF4me returns a document URL for the next step.


Step 3: Create Zugferd invoice (PDF4me)

This is the main generation step. It uses the uploaded JSON URL as input and returns a binary PDF (saved into a binary field like data).

Core settings to match

  1. Resource: Invoice.
  2. Operation: Create Zugferd Invoice.
  3. Input Data Type: Base64 String (matches the example run).
  4. Output Mode: XML With PDF (hybrid PDF).
  5. Conformance Level: BASIC (start here unless your receiver requires more).
  6. Zugferd Version: 1.0 (use the version your receiver expects).
  7. Language: English (or your preferred language).
n8n PDF4me Invoice Create Zugferd Invoice node showing base64 content, output mode, conformance level, version and language settings

Step 3 screenshot (part 1): invoice operation settings and core profile/version choices.

JSON mapping (URL input)

  1. Input Format: JSON.
  2. Invoice Data Input Type: URL.
  3. Invoice Data URL: map the URL output from Step 2 (the uploaded JSON document).
  4. Output File Name: set a predictable output name (example: zugferd_invoice.pdf).
  5. Output Binary Field Name: data (keep it consistent with Dropbox upload).
n8n settings for Create Zugferd Invoice: Input Format JSON, Invoice Data Input Type URL, Invoice Data URL expression, Output File Name and Output Binary Field Name data

Step 3 screenshot (part 2): JSON + URL mapping and binary output field name.


Step 4: Upload a file (Dropbox)

This publishes the generated PDF to Dropbox.

  1. Add Dropbox node.
  2. Resource: File. Operation: Upload.
  3. File Path: set full destination path including file name (example: /blog data/zugferd invoice/output/Zugferd_Result.pdf).
  4. Binary File: On.
  5. Input Binary Field: data (from Step 3).
  6. Execute the node and confirm Dropbox returns metadata (path, id, etc.).
n8n Dropbox Upload node configured with File Path blog data zugferd invoice output Zugferd_Result.pdf and Input Binary Field data

Step 4 screenshot: Dropbox upload publishes the generated invoice PDF.


Quick reference

#NodeKey setting
1TriggerExecute workflow (during setup)
2PDF4me – Upload File To PDF4meRetention hours + returns URL/token
3PDF4me – Create Zugferd InvoiceInput Format JSON + Data Input Type URL + Output Binary Field Name data
4Dropbox – UploadBinary File On + Input Binary Field data

Related reading: Create ZUGFeRD Invoice (docs), Power Automate version, Validate PDFA workflow.


Troubleshooting!

Dropbox upload fails with “binary field not found”

Your output node expects the binary field name you configured. Confirm Output Binary Field Name in Step 3 is data, and the Dropbox node uses the same Input Binary Field.

URL mapping returns “not found”

If you use Invoice Data Input Type = URL, the link must still be valid when the invoice node runs. Increase retention hours or regenerate the JSON URL immediately before Step 3.

401, 402, or connection errors

See PDF4me Troubleshooting for API keys, credits, and reconnecting the integration.