All workflows
Gmail logoAnthropic logoGoogle Sheets logo

Extract purchase orders from Gmail

Reads each new purchase order email, looks its items up in your product list, and logs every line with name and price.

On new email in Gmail3 apps5 steps

Apps it connects

Authenticate each one once and the workflow is ready to run.

What it does

Each integration step this workflow runs, in order, what it is for, and the conditions and loops that decide when it runs.

  1. 1GmailNew email triggerStarts a run when a new email lands in your inbox, optionally narrowed to one sender or domain, such as the address your orders come from.
  2. 2AnthropicGenerate model responseAsks the AI whether the email is a purchase order and, if so, to copy its PO number, customer, dates and each line's SKU, description and quantity.
  3. 3Google SheetsRead rowsReads your Products tab once, so each line's SKU can be matched to its product name and unit price.
  4. 4Google SheetsRead columnReads the Gmail message ID column of your Purchase orders tab, so an email that is already logged is not logged twice.
  5. For each rowToAdd

    1. 5Google SheetsAppend rowAdds one row per order line to your Purchase orders tab, with the product details, a line total and anything a person should check.

How it works

What happens on each run, in plain English.

When a new email arrives in your Gmail inbox, the AI checks whether it is a purchase order. If it is, it copies the PO number, customer, dates and each line's SKU, description and quantity exactly as written. Each SKU is looked up in the Products tab of your spreadsheet, and one row per line is added to your Purchase orders tab with the product name, unit price and a line total. Emails that are not orders - replies chasing an earlier order, quotes, invoices, newsletters - are skipped, and an email already in the log is not logged again.

The workflow refuses to guess. A SKU missing from your product list, a missing quantity or PO number, a price that could be read two ways, or an email the AI was not sure about goes in the line's Needs attention column rather than being filled in. The AI reads the email's text, not its attachments, so an order sent as an attached PDF still gets a row saying its lines need adding by hand.

You need a spreadsheet with a Products tab headed SKU, Product name and Unit price, and a Purchase orders tab for the log. Each new email starts its own run; if your orders all come from one address or domain, put it in the trigger's sender filter to keep the rest of your inbox away from the AI.

gmailgoogle sheetsanthropicpurchase ordersordersdata entryaitriggered

Start from a workflow that already works.

Add "Extract purchase orders from Gmail" to your workspace, connect its apps, and make it yours. No credit card required.

Free plan available · No credit card required