All workflows
Gmail logoOpenAI logoGoogle Sheets logo

Turn order emails into spreadsheet rows

Reads order emails hourly, has AI pull out each line item, and appends it to your order sheet.

Every hour3 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. 1GmailList emailsLists inbox emails matching your order search, excluding any already labelled 'Order logged' or 'Order needs review'.
  2. For each email

    1. If messageId is not empty and emailBody is not empty

      1. 2OpenAIQuery modelAsks the AI to list every item ordered with customer, reference, item, quantity and delivery date, never guessing a value.
    2. If orderRows is not empty and incompleteLines is 0

      1. For each orderRow

        1. 3Google SheetsAppend rowAppends one row per ordered item, written exactly as read and ending with the Gmail message id it came from.
    3. If messageId is not empty and wroteRows is true

      1. 4GmailAdd label to messageLabels each email 'Order logged' once its rows are written, or 'Order needs review' when anything was missing.
    4. If messageId is not empty and wroteRows is false

      1. 5GmailAdd label to message

How it works

What happens on each run, in plain English.

Every hour, the order emails matching your Gmail search are read from your inbox, the AI pulls out every item ordered, and one row per item is appended to the tab you name in your spreadsheet. Nobody has to re-key an order again.

Each row records the customer, order reference, item, quantity, requested delivery date and the message the order came from, so any row can be traced back to its email. Rows are only ever appended and written exactly as read, so nothing already in your sheet changes and no value is reinterpreted as a formula. If any value for any item is missing or unclear, the whole email is left out and labelled 'Order needs review' for a person to pick up. Handled emails are labelled 'Order logged', and both labels are excluded from the search, so a re-run never records the same order twice.

Before the first run, the tab needs a header row matching those six columns, and you need a Gmail search that finds your order emails.

gmailgoogle sheetsopenaiordersdata entryai

Start from a workflow that already works.

Add "Turn order emails into spreadsheet rows" to your workspace, connect its apps, and make it yours. No credit card required.

Free plan available · No credit card required