How to Use PO Automation

A plain-language guide to how incoming purchase orders flow through the system, what each tool does, and what to do when something needs a human. (For the technical build details, see the full project spec instead.)

Live in production orders@esqembroidery.com
1

The Big Picture

Every email to orders@esqembroidery.com is automatically read by AI, sorted into the right category, and — if it's a purchase order — turned into a row in the PO Queue Google Sheet with the order details already filled in. A human reviews the row, confirms the embroidery design and the customer contact are matched correctly, then clicks a button to send it to FileMaker.

Nothing gets written to FileMaker automatically. Every push is a deliberate human click, after review.

2

What Happens to Every Email

1
Email arrivesA Gmail filter tags it n8n/pending if the subject looks like a PO ("PO", "PO#", or "Purchase Order").
2
AI reads itClassifies as PO, Question, Supply Order, Revision, or Needs Review — and if it's a PO, extracts the order number, quantity, ship-to address, embroidery instructions, etc.
3
Row appears in a Sheet tabPO Queue for real orders, or the matching tab for Question/Supply Order/Needs Review/Revision. The email gets relabeled to match (see Section 8).
4
You review the rowCheck the design match (DST Picker) and the customer contact (Personnel Picker) if either is unmatched. See Section 3.
5
You click "Push →"Sends the order to FileMaker as an @Order record (plus Ship To and DST design links). See Section 6.
⚠️
If a real order email doesn't show up in PO Queue within a few minutes, the subject line probably didn't contain "PO"/"PO#"/"Purchase Order" — the filter never saw it. Use Force Process as PO (Section 7) instead of waiting.
3

Reviewing a PO in the Sheet

Open the PO Queue tab. Each row is one order. A few columns matter most for review:

ColumnWhat it means
picker_link"Review →" — opens the Personnel Picker to confirm/fix the matched company + contact for this PO. Always shown, even on a confident auto-match, so you can double-check.
company_master_id / personnel_idBlank means the AI couldn't confidently match a customer contact — use the picker link before pushing.
Instructions DisplayPlain-language summary of detected flags (Rush, Pick-Up, Split Shipping, 3rd Party, etc.) — a quick sanity check that the AI read the PO correctly.
push_link"Push →" — opens the FileMaker push confirmation page (Section 6). Shown once company/personnel are set, regardless of whether a design is matched yet.
Row background colorLight red = something's missing (company/personnel/design). Grey = already sent to FileMaker. Red = a push was attempted and failed — check fm_error for why.

Check the DST Items tab (linked rows below the same PO) for the embroidery design match — see Section 4 if it's not matched yet.

4

DST Picker — Matching a Design

Every embroidery placement on a PO needs to be linked to an actual digitized design file in FileMaker. The system tries several ways to match automatically, in order:

  • Remembered — you've resolved this exact wording for this company before (see "DST Aliases" below), so it's applied instantly. Row shows Auto (Remembered).
  • Exactly one exact-text match — filled in automatically. Row shows Auto.
  • Multiple possible matches, or only "similar" (not exact) matches — a Pick link appears on the DST Items row. Click it, search visually (with thread color swatches and prior-order history), and pick the right one(s).
  • No match found at all — same Pick link, search from scratch or flag it for manual FileMaker lookup.

On the picker page, check the box on more than one design card and hit Save Selected to attach several designs at once — useful when a customer's phrase (e.g. "Wagner Cat Rentals") actually maps to two files (a normal-background and a white-outline variant, say).

Open DST Picker

ℹ️
You don't have to resolve the design before pushing to FileMaker — see the "Push Anyway" note in Section 6. A design can always be matched later by coming back to this picker.
📜
DST Aliases sheet — the system's memory. Every design you pick via this picker is automatically remembered (per company + exact wording + colorway), so the next PO that uses the same phrasing auto-resolves without anyone touching the picker again. It's a normal sheet tab, so you can also add rows to it by hand to pre-teach the system a mapping before it's ever seen that phrase on a PO.
5

Personnel Picker — Fixing Company/Contact

Click any PO Queue row's "Review →" link to open this. It shows candidate customer contacts (matched by the sender's email address) — confirm the right one, or search by name/email/company if the AI's guess was wrong or ambiguous.

Open Personnel Picker

6

Pushing to FileMaker

Click "Push →" on a PO Queue row. You'll see a summary page — customer, company, contact, ship-to address, and every DST item on the order — before anything is sent.

  • If company or contact is still unmatched, the page blocks the push and tells you what's missing (go fix it via the picker links first).
  • If a DST item has no design match yet, you'll see a yellow warning and the button reads "Push Anyway" — clicking it pops a confirmation, then creates the Order and Ship To normally, just skipping that one design link (FileMaker requires an actual design match to create that record — there's no way to save a placeholder). Go back and match the design later; it won't create a duplicate order.
  • Once sent, the row turns grey and fm_status shows "Sent" — pushing again is blocked unless that's cleared manually first.
  • If a push fails, the row turns red and fm_error shows FileMaker's exact error message. Fix the underlying issue and try again — failed rows can always be retried.
7

Force Process as PO

Use this when an order never showed up in PO Queue automatically — almost always because the subject line was missing "PO"/"PO#"/"Purchase Order" (e.g. a customer just wrote the bare number, like "56348"). It's also useful if an email got sorted into the wrong tab (e.g. mistaken for a Supply Order) and you want to force it through as a real PO instead.

  1. Open Force Process as PO and type the PO number.
  2. You'll see every matching email to orders@ — subject, sender, date. Read carefully if there's more than one: sometimes a PO number shows up on an unrelated document too (e.g. a blank-garment supply order from the same vendor, or a reply in the same thread). Some resellers (DT Logos, confirmed) even reuse the exact same PO number for two completely different purchase orders — their own internal PO to a garment vendor, and the actual embroidery order to Esquire. Subject and sender alone can't always tell them apart — if a result looks ambiguous, process it and check whether the DST Items rows it creates actually have a design/search_term on them; a PO with no designs at all is a strong sign you picked the wrong one.
  3. Click "Process this one," confirm the popup, and it runs straight through extraction and lands in PO Queue — same as if the filter had caught it automatically, just skipping the AI classification step since you've already told it "this is a PO."
⚠️
This tool bypasses classification entirely — it will process whatever email you pick as a PO even if the content isn't actually a purchase order. Double-check the sender and subject before clicking "Process."
8

Gmail Labels — What They Mean

LabelMeaning
n8n/pendingWaiting to be processed. If an email sits here more than a few minutes, something's wrong — check the sender/subject, or use Force Process as PO.
n8n/PO-processedSuccessfully turned into a PO Queue row.
n8n/Supply-OrderRecognized as blank garments being shipped to Esquire (not a customer order) — logged, no PO Queue row created.
n8n/QuestionA customer question, not an order — logged for reference.
n8n/Needs-ReviewThe AI wasn't confident enough to auto-classify — check the Needs Review sheet tab.
n8n/RevisionRecognized as a follow-up/change request on an existing order, not a new one.
⚠️
Never manually remove n8n/pending — let the system do it after processing. And be careful applying labels from Gmail's inbox list view: it labels the whole email thread, not just the message you're looking at — open the specific message first if you need to label just one.
9

Common Situations

SituationWhat to do
Order never appeared in PO QueueUse Force Process as PO (Section 7)
Design not matched on a DST Items rowClick its picker link, search in DST Picker (Section 4)
Company/contact blank or wrong on a PO Queue rowClick "Review →", fix in Personnel Picker (Section 5)
Need to push without a design matched yetClick "Push Anyway" on the warning — see Section 6
Push failed (row is red)Read fm_error on the row, fix the issue, retry — failed pushes can always be retried
Same PO number used by two different documents/customersRead the email list carefully in Force Process as PO before picking one (Section 7)
Not sure what a Gmail label meansSee Section 8
10

Behind the Scenes — the n8n Workflows

Everything in Section 2 is actually run by a set of n8n workflows. You don't need to touch these day-to-day — but if you're ever poking around inside n8n, here's what each one is. The work is split into a main workflow that calls smaller SW ("sub-workflow") pieces, so any one part can be fixed or re-run on its own.

The live intake pipeline

WorkflowRuns whenWhat it does
PO Automation - Phase 2Every minute — watches Gmail for the n8n/pending labelThe main conductor. Picks up each new pending email, has the AI classify it (PO / Question / Supply Order / Revision / Needs Review), writes it to the correct Sheet tab, and calls the sub-workflows below.
SW2 - PDF HandlerCalled by Phase 2 (and the tools below)Downloads the email's attachments (the PO PDF / Excel) from Gmail so the AI can read them.
SW3 - Extract PO DataCalled when an email is a POReads the order and pulls out the structured details — PO number, quantities, ship-to, embroidery instructions, and so on.
SW4 - Write to SheetsCalled after extractionCreates the actual PO Queue row(s) and Ship-To rows in the Google Sheet.
SW5 - Label ManagerCalled at the end of every emailRemoves n8n/pending and adds the outcome label (n8n/PO-processed, n8n/Supply-Order, etc.) so you can see the result in Gmail.

Manual & recovery tools

WorkflowRuns whenWhat it does
SW0-Force - Process Email as POWhen you click Force Process as PO (Section 7)Takes the one email you picked and forces it through as a PO, skipping the AI classification step.
SW0-Backfill - Manual Gmail PullAutomatically every 15 min, plus an on-demand manual runSafety net. Scans for any email still stuck at n8n/pending (older than 10 minutes) and re-runs it through the normal pipeline — so nothing stays permanently stranded if the every-minute watcher ever misses one (e.g. several emails arriving in the same thread at once).
⚠️
Spotting a stranded email. If a Gmail thread shows n8n/pending and an outcome label (like n8n/Supply-Order) at the same time, it means some messages in that thread were processed but at least one got stranded — usually because several emails landed in the same thread within a minute of each other and the every-minute watcher only picked up one. The 15-minute Backfill sweep now clears these up on its own; to fix one right away, use Force Process as PO (Section 7) or run the Backfill manually.

Reference sync

WorkflowRuns whenWhat it does
DST File Master Weekly SyncWeekly (scheduled)Refreshes the list of digitized design files from FileMaker into the Sheet, so the DST Picker (Section 4) matches against current designs.
ℹ️
Workflows named DEMO — … are unrelated public demos (gemba-it.org) that run on fake data only — they are not part of Esquire's PO automation.
📜
For the full technical build (field mappings, FileMaker Data API, escaping rules), see the full project spec.