Guide · Make

Generate PDF documents from Make

The Docmill app for Make (formerly Integromat) adds one module — Generate a Document — that renders a template with your scenario's data and outputs the result as real binary file data, so it pipes straight into Email, Google Drive, Dropbox, and any other module that accepts a file.

What you need

Step 1 — Add the Docmill app and connect it

  1. Add the module

    In the scenario editor, click +, search for Docmill, and pick the Generate a Document action. (While the app is in Make's review queue it can also be imported as a custom app via the Make developer platform — the modules are identical.)

  2. Create the connection

    Click Add next to Connection and paste your API Key (dk_live_…) — the single field the connection needs. Make validates the key against your Docmill account before saving, so a bad key is caught immediately.

Step 2 — The Generate a Document module's fields

FieldRequiredWhat goes in it
TemplateYes A dropdown listing the templates in your account plus the built-in starters: starter:invoice, starter:quote, starter:report, starter:certificate.
Data (JSON)Yes The JSON object bound into the template. Map values from earlier modules with Make's mapping panel.
Output FormatNo PDF (default), DOCX, or XLSX — the same template renders to all three.

The module's output bundle has three items:

Because File Data is binary (not base64 text), downstream file inputs accept it directly — in most modules you can simply pick Docmill — Generate a Document as the source file.

A worked scenario: webhook → invoice PDF → Google Drive

  1. Webhooks — Custom webhook

    Create a webhook trigger and send it a test payload such as {"client_name": "Northwind Traders", "item": "Design sprint", "price": 4800} so Make learns the fields for mapping.

  2. Docmill — Generate a Document

    Template: starter:invoice · Output Format: PDF · Data (JSON), with webhook fields mapped in (shown as {{…}} pills in the editor):

    {
      "client": { "name": "{{client_name}}" },
      "items": [
        { "description": "{{item}}", "quantity": 1, "unitPrice": {{price}} }
      ],
      "total": {{price}}
    }

    Keep mapped text inside quotes and numbers bare so the field stays valid JSON.

  3. Google Drive — Upload a File

    Choose Docmill — Generate a Document as the source file, or map File Name and File Data manually. Swap this module for Email — Send an Email (attach File Data) or Dropbox just as easily.

Run the scenario once with Run once and post the test payload — you can download and inspect the generated PDF from the module's output bubble.

What the module does under the hood

One authenticated POST with ?encoding=base64; Make decodes the response to binary for you. If you want the same call anywhere else, it's this:

# one POST, one invoice (base64 envelope, as the Make module uses)
curl "https://api.docmill.io/v1/documents?encoding=base64" \
  -H "Authorization: Bearer dk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "starter:invoice",
    "data": { "client": {"name": "Northwind Traders"},
              "items": [{"description": "Design sprint",
                         "quantity": 1, "unitPrice": 4800}],
              "total": 4800 },
    "output": "pdf"
  }'
# → { "content_type": "application/pdf", "extension": "pdf",
#     "data_base64": "JVBERi0…" }

Drop the ?encoding=base64 query parameter and the API streams the raw file instead. Either way, "output": "docx" or "xlsx" gets you Word or Excel from the same template — in the module that's just the Output Format dropdown.

Making your own template (AI prompt-to-template)

Beyond the starters, describe the document you need once in plain language and Docmill drafts a reusable template saved to your account:

curl https://api.docmill.io/v1/templates/generate \
  -H "Authorization: Bearer dk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "A quote for a landscaping company with options,
        a validity window, and an estimated total." }'
# → template id + sample data showing exactly which fields to send

The new template shows up in the module's Template dropdown; shape your Data (JSON) after the sample data it returned. Templates are plain HTML underneath, so you can inspect and tweak them. AI template generation is included from the Starter plan ($19/mo) up.

Troubleshooting

SymptomCause & fix
[401] invalid or missing API key The connection's key is wrong or revoked. Re-create the connection with a fresh key from docmill.io.
[429] monthly quota reached You've used all documents on your plan this month (50 on Free). Upgrade at docmill.io/#pricing — one generated file always meters as one document.
[422] render error The data doesn't match the template's fields. Compare your Data (JSON) with the template's sample data.
Downstream module receives text, not a file Map File Data (the buffer), not Content Type or the JSON view, into the target module's file/data input.

Ready to add the document step?

Free tier: 50 documents/month, watermarked. Then $19/1,000 · $49/5,000 · $99/15,000 documents per month.

Start free API docs

More guides

Generate PDFs from n8n

Install the community node, map data, handle async bulk jobs.

Generate PDFs from Zapier

The Generate Document action, field mapping, and a worked Zap.

EU e-invoicing: the readable invoice

Pairing structured XML with a human-readable PDF in one flow.