Series title: Restaurant Purchase Order Automation & Daily Dispatch Reporting
Subtitle: AI-powered PDF order extraction, multi-outlet tracking, and automated warehouse dispatch reporting using n8n, Gmail, and Google Sheets.
This is a build log, not a survey of warehouse software. It documents one specific client problem, the five-node workflow built against it, and the four simulated purchase orders used to verify it. Everything here was configured and executed; nothing is a proposed feature described as if it already worked.
1. The client brief
The request arrived as a short, plain message from a warehouse operator:
I work in warehouse operations. I receive purchase orders from restaurants across Singapore - the same brand, but different outlets. The orders cover fresh produce, protein, frozen and dry goods. Each email comes with a PDF attachment. I open the PDF, read the order number and the quantities, and type them into my Google Sheet so I can prepare the daily dispatch. What I want is simpler: every order I receive in a day, no matter which outlet it came from, should be recorded in Google Sheets automatically and labelled with the right outlet or restaurant. How can this be done?
Every clause in that paragraph constrains the design. “Same brand, different outlets” means the outlet is a required dimension on every row, not a note in the email subject. “Fresh produce, protein, frozen and dry goods” means units will vary - kilograms, cartons, bags, bottles - and must not be normalised away. “A PDF attachment” means the input is a document, not a structured API payload. “So I can prepare the daily dispatch” means the output is a working list for a warehouse, not an archive of what was ordered.
The last sentence is the actual requirement: all orders, from whichever outlet, recorded automatically and labelled correctly. That is what this case study builds and tests.
2. What is actually being automated
The obvious reading is “email arrives, AI reads the PDF, data goes into a spreadsheet.” That reading is incomplete, and building to it produces a demo that looks finished but is useless at 6 a.m. in a warehouse.
Typing is only the visible part of the manual routine. The operator is not copying numbers for the sake of having a copy; they are assembling the list that decides what gets picked, staged and loaded for each outlet on each delivery date. A sheet with twenty rows is not that list. Two further questions have to be answerable from it:
- What does each outlet get, on each date? The picker and the driver need this.
- How much of each product do we stage in total today? The person preparing stock needs this, with the same product from several outlets merged into one number.
So the goal is better stated as a lightweight purchase order processing and daily dispatch system. The n8n workflow handles intake; the Google Sheets workbook handles the two warehouse questions. Keeping that split is what lets the whole thing stay at five nodes instead of growing into an application.

3. The four simulated purchase orders
Because no real client PDFs were available, the test data was built to be deliberately awkward. One brand, four outlets, two required delivery dates, and a different PDF template on the fourth order.
| File | Outlet | Delivery date | Line items |
|---|---|---|---|
PO-20261123-001.pdf | Orchard | 2026-11-23 | 5 |
PO-20261123-002.pdf | Marina Bay | 2026-11-23 | 5 |
PO-20261123-003.pdf | Jurong East | 2026-11-24 | 5 |
PO-20261123-004.pdf | Tampines | 2026-11-24 | 5 |
The fictional brand is Harbour Kitchen. Product codes follow four prefixes - VEG-, PRO-, FRZ-, DRY- - with categories Produce, Protein, Frozen and Dry Goods. Units are KG, CTN, BAG and BTL. The first three PDFs use a table headed Item Code | Product Description | Category | Quantity | Unit; the fourth uses OUTLET PURCHASE ORDER with columns SKU | Item / Description | Qty | UOM. That fourth template is the point of the test: a parser tuned to the first three would fail on it.
Twenty line items, split evenly across the two delivery dates, is small enough to check by eye and large enough to expose a merged row or a lost outlet.
4. The three-layer data model
One workbook, three sheets. n8n writes only the first; Google Sheets formulas maintain the other two.
| Sheet | Maintained by | Rows | Question it answers |
|---|---|---|---|
Order_Lines | n8n Append Row | 20 | What did every outlet order, exactly as written? |
Daily_Dispatch | QUERY formula | 20 | What does each outlet get on each delivery date? |
Product_Summary | QUERY formula | 19 | How much of each product do we stage in total today? |
Order_Lines is the immutable intake log: eleven columns, one row per product line, preserving the original quantity and unit. Daily_Dispatch groups by delivery date, outlet code, SKU, product and unit, producing a per-outlet sorting and delivery list. Product_Summary drops the outlet dimension and groups by delivery date, SKU, product and unit, producing the central staging list.
The 20 to 19 difference is not a bug and is worth understanding, because it is the clearest evidence that the second report is doing real work. On 2026-11-23, Orchard ordered Fresh Tomatoes 20 KG and Marina Bay ordered Fresh Tomatoes 15 KG. Daily_Dispatch correctly keeps them as two separate rows, because two different outlets need two different deliveries. Product_Summary merges them into 35 KG, because one warehouse stages tomatoes once. One row disappears, and that is exactly right.
Both formulas keep Unit as a grouping key. Quantities are only ever summed for the same SKU and the same unit, so kilograms are never added to cartons or bags.
5. The five-node workflow
The running workflow has five main nodes, with an AI Chat Model attached as a sub-node:
Gmail Trigger
-> Extract From File
-> Information Extractor (Chat Model sub-node)
-> Code
-> Google Sheets

| Node | Job |
|---|---|
| 01 Gmail Trigger | Catch purchase-order emails and download the PDF as binary attachment_0 |
| 02 Extract From File | Pull text out of the text-type PDF - no OCR needed here |
| 03 Information Extractor | Turn that text into one JSON order object with an items array |
| 04 Code | Expand the array into one row per product and normalise dates to YYYY-MM-DD |
| 05 Google Sheets | Append those rows to Order_Lines |

Two decisions kept the chain short. The originally planned Gmail Get Message node was dropped once Gmail Trigger’s Options -> Download Attachments returned the PDF binary directly, so one node does the work of two. And the two report sheets are Google Sheets QUERY formulas, not additional n8n nodes: when a new email appends rows, both reports update on their own, with no second workflow to run or maintain.
The division of labour is intentionally boring:
| Tool | Responsibility | In this MVP |
|---|---|---|
| Gmail | Collect purchase-order email and PDF attachment | Yes |
| n8n | Trigger, extract, structure, write | Yes |
| AI model | Structured field extraction from PDF text | Yes, as a sub-node |
| Google Sheets | Store raw lines and generate dispatch views | Yes |
| Airtable | Multi-view status tracking, product master | No - phase two |
| Google Drive | Archive original PDFs for audit | No - phase two |

6. Why the stack stays small
The client already runs the daily dispatch routine in Google Sheets. Introducing Airtable at this stage would mean training, a data migration and a subscription, none of which improves tomorrow morning’s dispatch by one minute. The value in this project is eliminating manual typing, not replacing a tool the warehouse already understands. Airtable becomes reasonable later, when several staff need to update order status at the same time or a product master table has to be maintained.
The same logic applies to the AI node. It is not there because every document pipeline needs a model. If all outlets generated PDFs from one system with fixed field positions, a deterministic parser would be cheaper and easier to audit. If the PDFs were scanned images, no schema would help and OCR would be mandatory. The model earns its place in the middle case - same brand, several outlets, slightly different layouts, text-type PDFs - which is what the four simulated orders reproduce. The only reliable way to choose for a real client is to look at one real, redacted purchase order PDF.
7. What was actually tested
The test ran in three stages rather than building all five nodes and debugging at the end: prepare the four PDFs and the sheet, run only PO 01 end to end, then activate the workflow and send the remaining three emails one at a time.

| Check | Result |
|---|---|
| Emails processed | 4 |
| PDFs parsed | 4, including the different fourth template |
| Distinct PO numbers | 4, no cross-contamination |
| Order lines written | 20 |
| Lines dated 2026-11-23 / 2026-11-24 | 10 / 10 |
| Distinct outlets | 4 |
| Quantities and units | Match the PDFs exactly |
Daily_Dispatch rows | 20 |
Product_Summary rows | 19 |
A useful spot-check: VEG-001 / Fresh Tomatoes appears in three purchase orders at 20, 15 and 30 KG. Order_Lines must keep three separate rows. If they merge, the outlet dimension has been lost and the dispatch list is wrong.
The fourth PDF also revealed a small, honest imperfection: the model returned category values Vegetables and Meat instead of Produce and Protein. It does not affect this build, because neither QUERY report uses Category, and the SKU prefixes remain consistent. A small mapping in the Code node would fix it if category reporting were ever needed. We note it rather than hiding it.
8. Where this demo stops
This is a purchase order data processing and dispatch preparation demo. It is not a production warehouse system and should not be described as one.
Not implemented, deliberately: duplicate-order detection (PO number plus outlet plus line), revised-order handling, exception review for unreadable quantities or outlets, human approval before a row reaches dispatch, inventory deduction, picking-list generation, dispatch confirmation emails, archiving the original PDF, or any audit of what was actually loaded onto a van. The workflow also cannot run unattended safely: Append Row has no memory, so re-running a node would append the same rows again.
Two safeguards would be non-negotiable in a production version - keep the original PDF for audit, and route uncertain rows to a person instead of letting a guessed quantity reach a dispatch sheet. Both are phase-two work.
The decision recorded at the end of the build was explicit: stop adding features. Five nodes already demonstrate the whole value chain, from a multi-outlet PDF to a warehouse-ready staging list. Adding Airtable, a database, another AI Agent or a notification workflow at this point would not make the case stronger; it would add untested claims to a result that is already clean. The next work is portfolio work - one architecture diagram, one case write-up with the real 4 / 20 / 19 numbers, and one short video - not more nodes.
9. Navigation
Part 1 - Capturing Purchase Order Emails and PDF Attachments Configure Gmail Trigger: search filters, Read Status, and the
Download Attachmentsoption that removes the need for a second Gmail node. Verify binaryattachment_0before anything else is built.Part 2 - From PDF Text to Structured Order Data Set up Extract From File and Information Extractor, with the full JSON Schema (including the
itemsarray), the ten-rule extraction instruction, and the Chat Model sub-node connection.Part 3 - Normalizing Order Lines with a Code Node The complete JavaScript that expands one order into one row per product and converts
20 Nov 2026to2026-11-20, plus the Schema / Table / JSON output views.Part 4 - Designing the Google Sheets Data Model and Append Row The eleven-column header, why Delivery Date is not the received date, why Quantity and Unit stay together, the service-account sharing gotcha, and Append Row configuration.
Part 5 - Daily Dispatch and Product Summary with QUERY Both
QUERYformulas in full, the column map, the 20 to 19 merge, why Unit is a grouping key, and the fix when a formula appears as plain text.Part 6 - Testing Four PDF Variants and Presenting the Result The three-stage test plan, the full verification checklist, the fourth-template result, portfolio positioning, and the demo script.
10. What a real engagement would need first
Three questions settle the technical scope before any price is discussed: are the PDFs text-based, scanned images, or unknown; roughly how many purchase orders arrive per day; and is the PDF template the same across outlets or does each outlet use its own. The most valuable single item to request is one real purchase order PDF with prices, phone numbers and other sensitive details redacted. That file determines whether AI is needed at all, what parsing approach to use, and how many rows one order produces.
For a fixed-scope project, two milestones are enough - a PDF Extraction Proof of Concept and Automated Order Processing & Delivery - even though the technical work has more steps. Proposals do not need one payment stage per testing step.
Data note: all business data in this series - Harbour Kitchen, the Orchard / Marina Bay / Jurong East / Tampines outlets, PO numbers, SKUs, quantities, units and delivery dates - is fictional mock data created for a tutorial and portfolio demonstration. It is not a real business and is not used for real contact. When shown in a portfolio, label it Self-initiated Demonstration.




