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.
What Happens to Every Email
n8n/pending if the subject looks like a PO ("PO", "PO#", or "Purchase Order").Reviewing a PO in the Sheet
Open the PO Queue tab. Each row is one order. A few columns matter most for review:
| Column | What 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_id | Blank means the AI couldn't confidently match a customer contact — use the picker link before pushing. |
Instructions Display | Plain-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 color | Light 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.
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).
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.
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_statusshows "Sent" — pushing again is blocked unless that's cleared manually first. - If a push fails, the row turns red and
fm_errorshows FileMaker's exact error message. Fix the underlying issue and try again — failed rows can always be retried.
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.
- Open Force Process as PO and type the PO number.
- 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. - 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."
Gmail Labels — What They Mean
| Label | Meaning |
|---|---|
n8n/pending | Waiting 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-processed | Successfully turned into a PO Queue row. |
n8n/Supply-Order | Recognized as blank garments being shipped to Esquire (not a customer order) — logged, no PO Queue row created. |
n8n/Question | A customer question, not an order — logged for reference. |
n8n/Needs-Review | The AI wasn't confident enough to auto-classify — check the Needs Review sheet tab. |
n8n/Revision | Recognized as a follow-up/change request on an existing order, not a new one. |
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.Common Situations
| Situation | What to do |
|---|---|
| Order never appeared in PO Queue | Use Force Process as PO (Section 7) |
| Design not matched on a DST Items row | Click its picker link, search in DST Picker (Section 4) |
| Company/contact blank or wrong on a PO Queue row | Click "Review →", fix in Personnel Picker (Section 5) |
| Need to push without a design matched yet | Click "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/customers | Read the email list carefully in Force Process as PO before picking one (Section 7) |
| Not sure what a Gmail label means | See Section 8 |
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
| Workflow | Runs when | What it does |
|---|---|---|
| PO Automation - Phase 2 | Every minute — watches Gmail for the n8n/pending label | The 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 Handler | Called 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 Data | Called when an email is a PO | Reads the order and pulls out the structured details — PO number, quantities, ship-to, embroidery instructions, and so on. |
| SW4 - Write to Sheets | Called after extraction | Creates the actual PO Queue row(s) and Ship-To rows in the Google Sheet. |
| SW5 - Label Manager | Called at the end of every email | Removes 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
| Workflow | Runs when | What it does |
|---|---|---|
| SW0-Force - Process Email as PO | When 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 Pull | Automatically every 15 min, plus an on-demand manual run | Safety 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). |
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
| Workflow | Runs when | What it does |
|---|---|---|
| DST File Master Weekly Sync | Weekly (scheduled) | Refreshes the list of digitized design files from FileMaker into the Sheet, so the DST Picker (Section 4) matches against current designs. |
DEMO — … are unrelated public demos (gemba-it.org) that run on fake data only — they are not part of Esquire's PO automation.