Downloads
Download the n8n workflow (JSON)
purchase-order-reader-n8n-claude.json · n8n workflow · 19 steps · starts with New PO email · uses Gmail, Google Sheets, Slack, Anthropic · 30 KB
Import into n8n: Create Workflow, then the menu, then Import from File.
How to import it into n8n
- In n8n, create a new workflow.
- Open the ⋯ menu at the top right and choose Import from File, then pick the downloaded .json. (Or open the file, copy everything and paste it on the canvas.)
- Open each node with a warning and connect your own account: the file carries no passwords or keys.
- Run it once with Test workflow, check the result, then switch it to Active.
What this workflow does
When a buyer emails a purchase order as a PDF, n8n catches it, pulls the text out and Claude reads it into fixed fields: PO number, buyer, GSTIN, delivery date, address, payment terms and every line with qty, rate and amount. A Code node then checks it against your quoted rates and lead times and re-does the maths. Clean POs go straight into your production sheet, one row per line. POs with a mismatch go to Slack first, where you choose Accept or Hold. A reply to the buyer waits in Gmail drafts.
Who it is for
Manufacturers, fabricators, printers, packaging and garment units, and distributors who receive POs by email and retype them into a production or order sheet.
What you need
- An n8n account (Cloud or self-hosted)
- The Gmail account where POs arrive
- An Anthropic API key for Claude
- A Google Sheet with your quoted rates and a production tab
- Slack for mismatch alerts
The workflow, step by step
Step 1 · Catch every PO email
New PO email checks Gmail every 5 minutes for emails with a PDF and words like PO or purchase order in the subject, and downloads the attachments. Get quoted rates reads your Rates tab once. Keep PDF attachments makes one item per PDF and ignores logos and images. Skip POs already read remembers each email id + file name, so a forwarded or re-sent PO is not entered twice.
Step 2 · Claude reads the PDF
Read PDF text extracts the text. If the PDF is a scan with no text, its error output goes to Unreadable PDF alert in Slack. Read the PO with Claude sends the email and PDF text to Claude at temperature 0 with one rule: copy what the document says, never guess. PO fields forces the structure, including a list of lines.
Step 3 · Checked against your quote
Check against quote compares each line's rate with your quoted rate for that buyer and item, re-does qty x rate, checks lines add up to the subtotal and subtotal + GST to the total, checks the GSTIN format, and compares the delivery date with today + your lead time. Any mismatch? splits clean POs from the rest.
Step 4 · Mismatches wait for you
Flag mismatch on Slack lists the exact issues, with the money difference, and buttons Accept PO and Hold. Accepted anyway? sends Accept into production; Hold goes to Log PO on hold in the PO log tab.
Step 5 · Into the production sheet
One row per line turns each PO into production rows. Add to production sheet writes them (matched on PO number + line, so no duplicates). One per PO collapses back to one item per PO, Draft acknowledgement creates a reply in the buyer's Gmail thread as a draft, and Post to production channel tells the floor a new PO is in.
Setup
- Import the JSON into n8n.
- Create the Sheet with tabs
Rates,ProductionandPO log(columns are in the Setup sticky note). FillRateswith your current quotes per buyer and item. - Connect Gmail on the trigger and the draft node, Google Sheets, Anthropic and Slack.
- Adjust the Gmail search in New PO email, for example add
from:(buyer1.com OR buyer2.com). - Email yourself a sample PO PDF with "PO" in the subject, run the workflow, and check the Slack message or the production rows.
How to customise
- Your own fields: add HSN code, colour, size or print details to PO fields and the production columns.
- ERP or Tally: replace Add to production sheet with an HTTP Request to your ERP's API, or export the sheet to Tally.
- Auto-acknowledge: if you trust it after a few weeks, swap the draft for a send, but only on the clean path.
- Scanned POs: add a branch that sends the PDF as an image to Claude when the extracted text is empty.
Guardrails
- Every check is done by code: rates, maths, totals, GSTIN format and lead time.
- A PO with any issue stays out of production until you tap Accept.
- Nothing is sent to the buyer automatically; the acknowledgement is a draft.
Troubleshooting
- PO not picked up: the subject must match the search. Test the query in Gmail's search box first.
- "No quoted rate on file" on every line: the
RatesBuyer and Item must appear inside the PO's buyer name and line text. Use short names. - Lines missing: very long POs may need a higher max tokens on Claude.
- Unreadable PDF alerts: the file is probably a scan. Enter it by hand or add an image branch.
Want the members-only resources too?
A free account unlocks them all, including the ones shared in DMs.

