PDF Workflow Automation with n8n and PDF Agile in 20 Min

PDF-Workflows automatisieren mit n8n und PDF Agile in 20 Min

🇬🇧 English

This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you.

PDF Workflow Automation with n8n and PDF Agile — Step by Step

Every team that handles invoices, contracts or reports knows the pain: a PDF lands in an inbox, someone manually extracts the relevant data, copies it into a spreadsheet, renames the file and forwards it to the right person. Multiply that by fifty documents a day and you have a serious productivity drain. This guide shows you how to close that loop in around 20 minutes using two tools that work exceptionally well together.

The PDF editing and processing side is handled by PDF Agile — an all-in-one PDF tool that covers editing, conversion, compression, OCR and signing. The automation glue is n8n, an open-source workflow platform with more than 400 integrations that you can self-host for free or run on n8n Cloud.

What You Will Build

The workflow you are about to create does the following automatically:

  • Watches a folder or email inbox for incoming PDFs
  • Runs OCR on scanned documents to make text machine-readable
  • Extracts key fields (invoice number, date, total, sender)
  • Writes those fields to a Google Sheet or Airtable base
  • Renames and moves the PDF to the correct storage folder
  • Sends a Slack or email notification to the responsible team member

No code required beyond a few n8n expressions. No manual copy-pasting. The whole setup takes roughly 20 minutes once your tools are connected.

Prerequisites

  • An n8n instance (self-hosted or n8n Cloud — free trial available)
  • A PDF Agile account for OCR and PDF manipulation
  • Access to Google Drive, Dropbox or a local folder as the document inbox
  • Optional: a Google Sheets or Airtable account for data logging
  • Optional: a Slack workspace or email account for notifications

Step 1 — Prepare Your PDFs with PDF Agile

Before automation can extract data, your PDFs need to be in a consistent, machine-readable state. This is where PDF Agile earns its place in the stack.

OCR for Scanned Documents

Open PDF Agile and use the OCR function on any scanned invoice or contract. OCR converts the image layer into selectable, copyable text. PDF Agile supports batch OCR, so you can process an entire folder in one go before your first workflow run. For ongoing automation, you will trigger OCR via the PDF Agile API or CLI from inside your n8n workflow.

Standardise the Layout

If different suppliers send invoices in wildly different formats, use PDF Agile's editing tools to confirm which text anchors you can rely on — labels like Invoice No.:, Total: or Due Date: that always appear in the same position or with the same prefix. These anchors become your extraction patterns in n8n.

Convert When Needed

Some documents arrive as Word files or images. PDF Agile converts them to PDF with a single click, ensuring every file entering your n8n workflow is in the same format.

Step 2 — Trigger the n8n Workflow

Open your n8n canvas and add a trigger node. The right choice depends on where PDFs arrive:

  • Google Drive Trigger — fires when a new file appears in a specific folder
  • Email Trigger (IMAP) — fires when an email with a PDF attachment arrives
  • Webhook Trigger — fires when an external system posts a file URL to n8n
  • Schedule Trigger — polls a folder every X minutes for new files

For most invoice workflows the Google Drive Trigger or IMAP Email Trigger is the simplest starting point. Configure it to filter for .pdf files only.

Step 3 — Extract Text from the PDF

n8n has a built-in Extract from File node (under the Utilities section) that can read text content from PDFs. Connect it to your trigger and pass the binary file data through it.

If the PDF was already OCR-processed by PDF Agile, the extracted text will be clean and structured. If not, you can call the PDF Agile API from an HTTP Request node first to run OCR on the fly, then pass the result to the Extract from File node.

Parse the Extracted Text

Use an n8n Code node (JavaScript) or a Set node with expressions to isolate the fields you need. A simple regex approach works well for labelled fields:

  • Invoice No\.: (\S+) → captures the invoice number
  • Total[:\s]+([0-9.,]+) → captures the total amount
  • Due Date[:\s]+(\d{2}[\/\-]\d{2}[\/\-]\d{4}) → captures the due date

Store each captured group as a named variable (e.g. invoiceNumber, totalAmount, dueDate) for use in subsequent nodes.

Step 4 — Write Data to Your Spreadsheet or Database

Add a Google Sheets node (or Airtable, Notion, or any database node) set to Append Row. Map your variables to the correct columns:

  • Column A → {{ $json.invoiceNumber }}
  • Column B → {{ $json.totalAmount }}
  • Column C → {{ $json.dueDate }}
  • Column D → {{ $json.fileName }}
  • Column E → {{ $now.toISO() }} (timestamp of processing)

Every processed PDF now creates a clean row in your log, giving you a full audit trail without any manual entry.

Step 5 — Rename and Route the File

Use an HTTP Request node or the Google Drive node to move the PDF to a destination folder and rename it using the extracted data. A reliable naming convention might be:

YYYY-MM-DD_InvoiceNo_Supplier.pdf

For example: 2024-06-15_INV-4821_AcmeCorp.pdf

You can branch the routing with an IF node: invoices above a certain amount go to a Finance Review folder; below the threshold they move straight to Approved. Contracts go to a separate Legal folder. The logic is entirely up to you.

Step 6 — Send a Notification

Add a Slack node or Send Email node at the end of each branch. The message might read:

"📄 New invoice processed: INV-4821 from AcmeCorp — €3,420 due 2024-07-01. File saved to Finance Review."

The responsible person gets the context they need without opening their email client or file manager. Response time drops, errors drop and nobody has to chase a PDF through a shared inbox again.

Extending the Workflow

Automatic Approval Emails

Connect an email node to send a payment-approval request to a manager whenever a high-value invoice is detected. Include a link to the PDF in Google Drive so the approver can review it instantly.

Duplicate Detection

Before writing to the spreadsheet, query the existing rows to check whether the invoice number already exists. If it does, route the file to a Duplicates folder and send an alert instead of creating a second row.

Multi-language OCR

PDF Agile's OCR engine handles multiple languages. If your team receives documents in German, French or Spanish, the same workflow processes them without any additional configuration on the n8n side.

Time Estimate

  • OCR setup in PDF Agile: 3 minutes
  • n8n trigger and file extraction: 5 minutes
  • Text parsing and field mapping: 5 minutes
  • Routing logic and notifications: 5 minutes
  • Test run and adjustments: 2 minutes

Total: around 20 minutes for a workflow that then runs itself indefinitely.

Summary

PDF automation is one of the highest-ROI workflows you can build. The combination of PDF Agile for reliable OCR and document preparation, and n8n for routing and integration, eliminates a category of repetitive manual work entirely. Once the workflow is live, every incoming document is processed, logged, filed and communicated — in seconds rather than minutes, and without anyone touching a keyboard.

If you handle PDFs manually every day and want to route them automatically, you can build and self-host your first workflow via n8n — including 400+ integrations and a free self-hosting option — to eliminate repetitive document tasks for good.

🇩🇪 Deutsch

Dieser Artikel enthält Affiliate-Links (Werbung). Kaufst du darüber, erhalten wir ggf. eine Provision – für dich ohne Mehrkosten.

PDF-Workflows automatisieren mit n8n und PDF Agile – Schritt für Schritt

Rechnungen, Verträge, Berichte: In den meisten Teams landet täglich ein Stapel PDFs im Postfach, der dann manuell gesichtet, umbenannt, weitergeleitet und irgendwo abgelegt wird. Bei zehn Dokumenten am Tag ist das lästig. Bei fünfzig ist es ein ernstes Effizienzproblem. Dieser Artikel zeigt, wie du diesen Prozess in rund 20 Minuten vollständig automatisierst – mit zwei Tools, die perfekt zusammenpassen.

Für die PDF-Verarbeitung nutzt du PDF Agile – ein All-in-One-PDF-Tool mit OCR, Bearbeitung, Konvertierung, Komprimierung und Signatur. Für die Automatisierungslogik kommt n8n zum Einsatz: eine Open-Source-Plattform mit über 400 Integrationen, die du kostenlos selbst hosten oder als Cloud-Version nutzen kannst.

Was du aufbauen wirst

Der fertige Workflow erledigt folgende Schritte automatisch:

  • Überwacht einen Ordner oder ein E-Mail-Postfach auf eingehende PDFs
  • Führt OCR auf gescannten Dokumenten durch, damit der Text maschinenlesbar wird
  • Extrahiert relevante Felder wie Rechnungsnummer, Datum, Betrag und Absender
  • Schreibt diese Felder in eine Google-Tabelle oder eine Airtable-Datenbank
  • Benennt das PDF automatisch um und verschiebt es in den richtigen Zielordner
  • Sendet eine Benachrichtigung per Slack oder E-Mail an die zuständige Person

Kein Programmiercode nötig – nur ein paar n8n-Ausdrücke. Kein manuelles Kopieren. Der Aufbau dauert etwa 20 Minuten, danach läuft der Workflow von selbst.

Voraussetzungen

  • Eine n8n-Instanz (selbst gehostet oder n8n Cloud – kostenlose Testphase verfügbar)
  • Ein PDF Agile-Konto für OCR und PDF-Bearbeitung
  • Zugang zu Google Drive, Dropbox oder einem lokalen Ordner als Dokumenten-Eingang
  • Optional: Google Sheets oder Airtable für die Datenprotokollierung
  • Optional: Slack oder ein E-Mail-Konto für Benachrichtigungen

Schritt 1 – PDFs mit PDF Agile vorbereiten

Damit eine Automatisierung Daten zuverlässig extrahieren kann, müssen die PDFs maschinenlesbar und einheitlich strukturiert sein. Genau hier kommt PDF Agile ins Spiel.

OCR für gescannte Dokumente

Öffne PDF Agile und wende die OCR-Funktion auf gescannte Rechnungen oder Verträge an. OCR wandelt die Bildebene in auswählbaren, kopierbaren Text um. PDF Agile unterstützt Batch-OCR, sodass du einen ganzen Ordner auf einmal verarbeiten kannst. Für laufende Automatisierungen rufst du die PDF-Agile-API direkt aus dem n8n-Workflow heraus auf.

Layout vereinheitlichen

Wenn verschiedene Lieferanten Rechnungen in unterschiedlichen Formaten schicken, prüfe in PDF Agile, welche Textanker verlässlich vorhanden sind – zum Beispiel Bezeichnungen wie Rechnungsnr.:, Gesamtbetrag: oder Fälligkeitsdatum:. Diese Anker werden später deine Extraktionsmuster in n8n.

Dateien bei Bedarf konvertieren

Manche Dokumente kommen als Word-Datei oder Bild an. PDF Agile konvertiert sie mit einem Klick ins PDF-Format, sodass jede Datei, die in deinen n8n-Workflow eintritt, dasselbe Format hat.

Schritt 2 – Den n8n-Workflow auslösen

Öffne dein n8n-Canvas und füge einen Trigger-Node hinzu. Die richtige Wahl hängt davon ab, wo PDFs ankommen:

  • Google Drive Trigger – feuert, wenn eine neue Datei in einem bestimmten Ordner erscheint
  • E-Mail Trigger (IMAP) – feuert, wenn eine E-Mail mit PDF-Anhang eingeht
  • Webhook Trigger – feuert, wenn ein externes System eine Datei-URL an n8n sendet
  • Schedule Trigger – prüft einen Ordner alle X Minuten auf neue Dateien

Für die meisten Rechnungsworkflows ist der Google Drive Trigger oder der IMAP-E-Mail-Trigger der einfachste Einstieg. Konfiguriere ihn so, dass er ausschließlich auf .pdf-Dateien reagiert.

Schritt 3 – Text aus dem PDF extrahieren

n8n verfügt über einen eingebauten Extract from File-Node (im Bereich Utilities), der Textinhalte aus PDFs lesen kann. Verbinde ihn mit deinem Trigger und leite die binären Dateidaten durch ihn.

Wenn das PDF bereits in PDF Agile per OCR verarbeitet wurde, ist der extrahierte Text sauber und strukturiert. Falls nicht, kannst du zuerst einen HTTP-Request-Node einsetzen, der die PDF-Agile-API aufruft und OCR on the fly ausführt, bevor der Text weiterverarbeitet wird.

Den extrahierten Text parsen

Nutze einen n8n Code-Node (JavaScript) oder einen Set-Node mit Ausdrücken, um die benötigten Felder zu isolieren. Reguläre Ausdrücke funktionieren gut für beschriftete Felder:

  • Rechnungsnr\.: (\S+) → erfasst die Rechnungsnummer
  • Gesamtbetrag[:\s]+([0-9.,]+) → erfasst den Betrag
  • Fälligkeitsdatum[:\s]+(\d{2}[\/\-]\d{2}[\/\-]\d{4}) → erfasst das Datum

Speichere jede erfasste Gruppe als benannte Variable (z. B. rechnungsnummer, betrag, faelligkeitsdatum), die du in nachfolgenden Nodes verwenden kannst.

Schritt 4 – Daten in die Tabelle oder Datenbank schreiben

Füge einen Google Sheets-Node (oder Airtable, Notion oder einen anderen Datenbank-Node) hinzu und stelle ihn auf Zeile anhängen ein. Weise deine Variablen den richtigen Spalten zu:

  • Spalte A → {{ $json.rechnungsnummer }}
  • Spalte B → {{ $json.betrag }}
  • Spalte C → {{ $json.faelligkeitsdatum }}
  • Spalte D → {{ $json.dateiname }}
  • Spalte E → {{ $now.toISO() }} (Zeitstempel der Verarbeitung)

Jedes verarbeitete PDF erzeugt nun eine saubere Zeile in deinem Protokoll – ein vollständiger Prüfpfad ohne manuelle Eingabe.

Schritt 5 – Datei umbenennen und weiterleiten

Verwende einen HTTP-Request-Node oder den Google-Drive-Node, um das PDF in einen Zielordner zu verschieben und mit den extrahierten Daten umzubenennen. Eine bewährte Namenskonvention lautet:

JJJJ-MM-TT_RechnungsNr_Lieferant.pdf

Beispiel: 2024-06-15_RE-4821_MusterGmbH.pdf

Mit einem IF-Node kannst du die Weiterleitung verzweigen: Rechnungen über einem bestimmten Betrag gehen in den Ordner Freigabe erforderlich, darunter direkt in Genehmigt. Verträge landen in einem separaten Rechtsabteilung-Ordner. Die Logik liegt vollständig bei dir.

Schritt 6 – Benachrichtigung senden

Füge am Ende jedes Zweigs einen Slack-Node oder E-Mail-Node hinzu. Die Nachricht könnte lauten:

„📄 Neue Rechnung verarbeitet: RE-4821 von Muster GmbH – 3.420 € fällig am 01.07.2024. Datei gespeichert unter: Freigabe erforderlich."

Die zuständige Person erhält sofort den relevanten Kontext, ohne Postfach oder Dateimanager öffnen zu müssen. Reaktionszeiten sinken, Fehler sinken und niemand muss mehr ein PDF durch ein gemeinsames Postfach jagen.

Den Workflow erweitern

Automatische Freigabe-E-Mails

Verbinde einen E-Mail-Node, der bei hochrangigen Rechnungen automatisch eine Freigabeanfrage an eine Führungskraft sendet – inklusive Link zur Datei in Google Drive, damit die Freigabe sofort erteilt werden kann.

Duplikaterkennung

Bevor du eine neue Zeile in die Tabelle schreibst, frage die vorhandenen Zeilen ab und prüfe, ob die Rechnungsnummer bereits existiert. Falls ja, leite die Datei in einen Duplikate-Ordner um und sende eine Warnung, anstatt einen zweiten Eintrag zu erstellen.

Mehrsprachige OCR

Die OCR-Engine von PDF Agile verarbeitet mehrere Sprachen. Wenn dein Team Dokumente auf Englisch, Französisch oder Spanisch erhält, verarbeitet derselbe Workflow sie ohne zusätzliche Konfiguration auf der n8n-Seite.

Zeitbedarf im Überblick

  • OCR-Einrichtung in PDF Agile: 3 Minuten
  • n8n-Trigger und Dateiextraktion: 5 Minuten
  • Textparsing und Feldzuordnung: 5 Minuten
  • Weiterleitungslogik und Benachrichtigungen: 5 Minuten
  • Testlauf und Anpassungen: 2 Minuten

Gesamt: rund 20 Minuten für einen Workflow, der danach unbegrenzt eigenständig läuft.

Fazit

PDF-Automatisierung gehört zu den Workflows mit dem höchsten ROI, die du aufbauen kannst. Die Kombination aus PDF Agile für zuverlässige OCR und Dokumentenvorbereitung sowie n8n für Weiterleitung und Integration beseitigt eine gesamte Kategorie repetitiver manueller Arbeit. Sobald der Workflow aktiv ist, wird jedes eingehende Dokument verarbeitet, protokolliert, abgelegt und kommuniziert – in Sekunden statt Minuten, ohne dass jemand eine Tastatur anfassen muss.

Wenn du täglich PDFs manuell verarbeitest und diesen Prozess vollständig automatisieren möchtest, kannst du über n8n deinen ersten Workflow aufbauen und selbst hosten — inklusive über 400 Integrationen und kostenloser Selbst-Hosting-Option — und wiederkehrende Dokumentenaufgaben ein für alle Mal eliminieren.