This is Part 4 of the “Restaurant PO Automation” series. Part 3 produced five flat n8n items from one purchase order, each with keys named for a spreadsheet column. This post builds the destination: the
Order_Linessheet, its header, the credential sharing that makes the document visible to n8n, and the Append Row node that writes the first five rows.Series guide: Restaurant Purchase Order Automation: Series Guide & Case Study
1. The sheet is the product, not a database
It is tempting to treat Google Sheets as a dumping ground for whatever the AI node happens to emit. That is the wrong framing. For this client, the spreadsheet is the deliverable. The warehouse opens it in the morning, filters it, and uses it to pick, pack and load. If the columns are wrong, the automation has failed even if every n8n node shows green.
So we design the header first, on paper, before configuring the last node. The question is not “what did the model return?” but “what does a warehouse picker need to see on a row?” A row has to answer: which order is this, which outlet is it for, when does it have to arrive, what exactly is the product, and how much of it, in which unit.
2. The eleven-column header
Create a workbook named Restaurant PO Automation - Demo and a first sheet named Order_Lines. Paste this single line into cell A1:
PO_Number | Order_Date | Delivery_Date | Brand | Outlet | Outlet_Code | SKU | Product | Category | Quantity | Unit
Sheets will split it into eleven columns automatically.
| Column | Purpose |
|---|---|
PO_Number | The order identifier; the natural key for tracing and, later, deduplication |
Order_Date | When the restaurant placed the order |
Delivery_Date | When the goods must arrive; the field every dispatch view filters on |
Brand | Restaurant brand, here the fictional Harbour Kitchen |
Outlet | Full outlet name, e.g. Harbour Kitchen - Orchard |
Outlet_Code | Short stable code, e.g. HK-ORC-01 |
SKU | Product code, e.g. VEG-001 |
Product | Product description as written on the PO |
Category | Produce / Protein / Frozen / Dry Goods |
Quantity | Numeric amount, no unit text inside it |
Unit | KG, CTN, BAG, BTL |
We keep both Outlet and Outlet_Code. The full name is what a human reads; the short code is what a QUERY formula groups by in Part 5 without worrying about spelling variants across outlets. Keeping Brand alongside Outlet costs one column and preserves the “same brand, different outlets” structure the client described.
The header names are not arbitrary. They are exactly the keys the Code node outputs. That identity is what lets the final node use automatic mapping instead of eleven manual drag-and-drop assignments.
3. Two rules that decide whether dispatch is correct
Most data-model mistakes in this kind of project are not technical; they are two quiet assumptions.
Delivery Date is not the date the email arrived. A restaurant may send an order today for tomorrow, the day after, or next week. In this demo, PO 01 and PO 02 are both delivered on 2026-11-23, while PO 03 and PO 04 are delivered on 2026-11-24. If we had stamped every row with the received date, the daily dispatch view would be wrong on half the orders. When a PDF contains no explicit delivery date, the correct behaviour is to mark it to be confirmed and route it to a human, not to default to same-day delivery.
Quantity must be stored together with its Unit. 10 KG, 10 CTN and 10 BAG are completely different physical amounts. Fresh produce, protein and frozen goods also arrive in different packaging - cartons, bags, kilograms, bottles. The first version of this workflow preserves the original quantity and the original unit from the PDF and performs no conversion at all. Conversion is a business decision with a lookup table behind it, not a string operation in a workflow.
These two rules are the reason the header has eleven columns rather than a compact five. The extra fields are cheap; a wrong delivery date or a unit-less quantity is not.
4. Fields deliberately left out
A real purchase-order system would want more. We discussed these and left them out of the MVP on purpose:
| Field | Why it is not in this demo |
|---|---|
Received Date | Useful for audit, but the delivery date is what dispatch depends on |
Dispatch Status (Pending / Packed / Dispatched) | Requires a write-back loop and a human updating the sheet; adds a second workflow |
Source Email / PDF link | Needs Google Drive archiving and a link written back into the row |
Needs Review flag | Requires an exception queue and a review process that does not exist yet |
ErrorLog sheet | Only meaningful once validation and retry logic exist |
This is not oversight; it is scope control. Each of those fields implies a process, and a process implies someone responsible for it. Adding the columns without the process produces a sheet that looks complete but is not maintained, which is worse than an honest small one.
5. Why Google Sheets and not Airtable
Airtable would give us multiple views, status tracking, a product master table and a nicer mobile experience. It is a good tool, and it is the right answer for a second phase when several warehouse staff need to work the same orders at once.
It is not the right answer for this client’s first phase. The client already runs the daily dispatch routine in Google Sheets. Replacing that habit adds training, data migration and a subscription, none of which directly improves tomorrow morning’s dispatch. The value in this project comes from eliminating manual typing, not from changing the tool the warehouse already knows. n8n has native Gmail, PDF and Google Sheets nodes, so the whole MVP fits in the stack the client already uses.
6. Creating the workbook and sharing it with the n8n service account
Here is the gotcha that cost the most time in the actual build, and it has nothing to do with n8n logic.
After creating the sheet and setting up a Google Sheets credential, the node’s Document dropdown could not find Restaurant PO Automation - Demo. The credential was valid; the document simply was not visible to it. Google Sheets nodes can only see files shared with the service account email associated with that credential.

The fix is to open the workbook’s Share dialog and add the service account email from the n8n Google credential as an editor.

Once sharing is in place, return to n8n and refresh the node. The Document and Sheet dropdowns resolve immediately.

If you skip this step, no amount of re-authenticating the OAuth credential will help. Check sharing first.
7. Configuring the Google Sheets node
Add the final node after Code and configure:
| Parameter | Setting |
|---|---|
| Resource | Sheet Within Document |
| Operation | Append Row |
| Document | Restaurant PO Automation - Demo |
| Sheet | Order_Lines |
| Mapping Column Mode | Map Automatically |
Append Row is correct because this workflow accumulates history. Every new purchase order adds its lines; nothing is overwritten. That is what makes the later QUERY reports able to look across all four outlets and both delivery dates.
Map Automatically works here only because the Code node’s output keys were named to match the header exactly. It is a small discipline decision made in Part 3 that removes eleven manual mappings and, more importantly, removes eleven places where a future field rename could silently break the write.
8. Verifying the field mapping
Even with automatic mapping, open the mapping panel and read it once. Confirm that Delivery_Date is going to column C, Outlet_Code to column F, Quantity to column J and Unit to column K. Those four positions matter because the QUERY formulas in Part 5 refer to columns by letter, not by name.

A shifted column here would not throw an error. It would quietly write quantities into the unit column and produce a dispatch report that looks plausible and is wrong. This is the kind of failure that a green execution log cannot catch.
9. First end-to-end append
Execute the node with the five items from PO 01:
| Check | Result |
|---|---|
| Items received by Google Sheets | 5 |
Rows appended to Order_Lines | 5 |
| Nodes green end to end | 5 of 5 |
Order_Date / Delivery_Date | 2026-11-20 / 2026-11-23 |
| Units preserved | KG, KG, KG, CTN, BAG |


At this point the loop the client asked for is closed: an email with a PDF arrives, and the order appears in Google Sheets labelled with its outlet, without anyone opening the file. Everything in Part 5 and Part 6 is about making those rows useful and proving they hold up across outlets.
10. The duplicate trap and the demo boundary
There is one operational rule for this MVP: do not manually re-execute the Google Sheets node for an order that already ran. Append Row has no memory. Running it twice appends the same five rows again. In the real test sequence we save and activate the workflow, then send the remaining three emails so Gmail Trigger produces three fresh executions; we never replay the first one by hand.
That is the clearest illustration of the boundary. This is a demo, not a production warehouse system. There is no duplicate detection keyed on PO Number plus outlet plus line, no handling of revised orders, no exception queue, no audit of actual dispatched quantities, and no human review step for a quantity the AI could not read. A production version would keep the original PDF for audit and route uncertain rows to a person before they reach a dispatch sheet. We stop at five nodes because adding those features would not make this case study more convincing; it would add untested claims.
Next: Part 5 - Daily Dispatch and Product Summary with QUERY
Data note: all business data in this series - Harbour Kitchen, its outlets, PO numbers, SKUs, quantities and delivery dates - is fictional mock data for a Self-initiated Demonstration. This is a demo, not a production warehouse system.




