Skip to main content

Classify Document in Make

What this module does

PDF4me — Classify Document reads a PDF and returns a Class Name that identifies what type of document it is — invoice, contract, receipt, or any custom class you define. Classification rules (regex or JavaScript expressions) are set up once in your PDF4me account at dev.pdf4me.com. When a PDF passes through the module in Make, it is matched against those rules and the winning class label is returned. Feed that label into a Make Router to send the document to the right folder, pick the correct parse template, or trigger a type-specific downstream action — all without any manual sorting.

Authenticating Your API Request

Every PDF4me module in Make requires a valid Connection. Create or select one that holds your PDF4me API key so the scenario can authenticate classification requests securely.

Important Facts You Should Not Miss

Define classes in your account first — not in Make
Classification rules live in your PDF4me dashboard at dev.pdf4me.com → Classify Document. Add a Class Name (e.g. pdf4me_invoice) and a Regular Expression or JavaScript expression (e.g. invoice(.*)), then click Save Changes. The Make module has no fields for defining rules — it only applies the rules you saved in your account.
The module returns Class Name only — not the PDF
Classify Document outputs two fields: Class Name (the matched label) and Trace Id (for debugging). It does not return or modify the PDF file. If you need to pass the PDF to a downstream module — upload it, parse it, or email it — map the Document output from the prior download or trigger step, not from this module.
One credit consumed per classification run
Each execution of the Classify Document module uses one PDF4me credit — whether or not a class match is found. For scenarios that process large document volumes (hundreds or thousands of PDFs daily), plan your credit allocation in the PDF4me dashboard before enabling the scenario at scale. Add a Router fallback branch for unmatched documents to avoid silent failures.
Make PDF4me Classify Document module showing Connection set to My PDF4me connection, File Name mapped from step 1 file name, and Document mapped from step 1 data

The module only needs File Name and Document from a prior download step. Classification rules are read from your PDF4me account automatically — no rule configuration inside Make.

Parameters

Prerequisite: Create at least one document class at dev.pdf4me.com → Classify Document before using this module. See Set Up Classify Document for the full walkthrough.

ParameterRequiredWhat it doesExample
ConnectionYesPDF4me API connection. Click Add and paste your API key if connecting for the first time.My PDF4me connection
File NameYesFilename of the PDF to classify including .pdf extension. Map from the prior module's file name output.document.pdf
DocumentYesBinary content of the PDF to classify. Map from the prior module's data output — Dropbox, Google Drive, HTTP, or email attachment.1. Data

Output Fields

FieldDescription
Class NameThe matched class label (e.g. pdf4me_invoice, Contract). Use this in your Router or rename step.
Trace IdUnique identifier for this classification run — useful for debugging or audit logging.

Quick Setup

  1. Go to dev.pdf4me.com → Classify Document, click Edit, add a Class Name (e.g. pdf4me_invoice) with a Regular Expression (e.g. invoice(.*)), and click Save Changes.
  2. In your Make scenario, add PDF4meClassify Document after a file download step.
  3. Select Connection (or click Add to create one with your PDF4me API key).
  4. Map File Name and Document from the prior download or trigger module.
  5. Click Save and run the scenario. The Class Name output contains the matched document type — connect it to a Router to branch by type, an upload module to save to a type-specific folder, or a rename step to prefix the filename with the class.

Workflow Examples

Workflow ExamplesCommon Make scenario patterns using Classify Document.
Route invoices, contracts & receipts to separate folders
  1. Dropbox Watch Folder triggers when a new PDF lands in an "Incoming" folder.
  2. Dropbox Download a File retrieves the PDF binary.
  3. Classify Document returns Class Name — e.g. pdf4me_invoice, pdf4me_contract, or pdf4me_receipt.
  4. Router branches on Class Name: invoice → /Accounting/Invoices/, contract → /Legal/Contracts/, receipt → /Finance/Receipts/.
  5. Each branch uploads the PDF (from the download step, not Classify) to its target folder. Slack notifies the relevant team.
Classify then parse with the right template
  1. Email Watch triggers when a PDF attachment arrives in the accounts inbox.
  2. Classify Document identifies whether it is an invoice, a purchase order, or a delivery note.
  3. Router branches on Class Name and runs the matching Parse Document module — invoice template for invoices, PO template for purchase orders.
  4. Extracted data (total, vendor, date) is written to a Google Sheet row for each document type.
  5. One scenario handles any document type — no manual sorting before processing.
Auto-rename files by document type on arrival
  1. Google Drive Watch Files triggers when a new PDF is uploaded to a shared "Documents" folder.
  2. Google Drive Get a File downloads the binary.
  3. Classify Document returns the Class Name — e.g. pdf4me_contract.
  4. Google Drive Upload a File re-saves the PDF with a prefixed filename: Class Name + underscore + original name (e.g. pdf4me_contract_NDA_2025.pdf).
  5. The original unnamed file is moved to an archive subfolder for reference.

Frequently Asked Questions

Where do I create and manage classification rules?+
Rules are created at dev.pdf4me.com under the Classify Document section — not inside Make. Click Edit, add a Class Name and an expression (Regular Expression or JavaScript), then click Save Changes. The Make module automatically reads all saved classes from your account each time it runs. See the Set Up Classify Document guide for screenshots and full walkthrough.
What expression types are supported for defining a class?+
Two types: Regular Expression and JavaScript. Regex expressions match text patterns found anywhere in the PDF text content — for example, invoice(.*) matches any document containing the word "invoice". JavaScript expressions let you write more complex logic — multiple conditions, scored matching, or length-based rules — for documents where a single regex is insufficient.
What does the module output — does it return the PDF?+
No. The module outputs two text fields: Class Name (the matched class label, e.g. pdf4me_invoice) and Trace Id (a unique run identifier for debugging). The PDF itself is not returned. To pass the document to a downstream upload, email, or parse module, map the Document field from the prior download or trigger step — not from Classify Document.
What happens when no class expression matches the document?+
When no expression matches, the Class Name output is empty or contains an unmatched indicator. Add a fallback branch to your Router that handles empty Class Names — for example, route unclassified documents to a "Manual Review" folder and send a Slack alert. This prevents unmatched PDFs from being silently dropped or misrouted.
How many credits does each classification use?+
One credit per module execution, regardless of whether a match is found. For high-volume scenarios — processing hundreds of PDFs daily — estimate your monthly credit consumption before enabling at scale. Use the PDF4me dashboard to monitor usage and set up credit alerts if needed.

Get Help