Quick overview
This workflow collects purchase order PDFs via an n8n Form, extracts header and line-item data using easybits Extractor, appends the results to Google Sheets with duplicate detection, and optionally generates an EDI 850 file per new PO and uploads it to Google Drive.
How it works
- Receives a form submission where a user uploads one or more purchase order PDFs and chooses whether to generate an EDI 850 file.
- Reads existing rows from a Google Sheets tab to build a list of already-processed PO numbers for deduplication.
- Splits the uploaded files into one PDF per item and processes them sequentially.
- Uses easybits Extractor to pull PO header fields and the full articles table from each PDF.
- Skips POs whose extracted PO number already exists in Google Sheets, while tracking duplicates for the final summary.
- For each new PO, flattens the articles into one row per line item (calculating totals and flagging missing fields) and appends the rows to Google Sheets.
- If EDI generation is enabled, reshapes the extracted PO into a canonical object, runs a sub-workflow to generate an EDI 850 file, and uploads the resulting .edi file to Google Drive.
- Displays a completion screen summarizing clean extractions, duplicates skipped, and any missing fields detected per document.
Setup
- Create and connect an easybits Extractor API credential at https://easybits.tech/, and configure the extractor fields to return PO header values and an articles array from PDFs.
- Add Google Sheets credentials, then set the target spreadsheet ID and sheet/tab ID for both reading existing POs and appending new line-item rows.
- Ensure your Google Sheet header row matches the fields the workflow writes (for example: Date, Customer, Supplier, LPO No, Delivery Date, Items, Unit, Qty, Rate, Total, Document Name).
- If you enable EDI output, set the Execute Workflow node to the correct “Generate EDI 850” sub-workflow ID and ensure it returns a binary file for upload.
- Add Google Drive credentials and select the destination folder ID where generated .edi files should be uploaded.