Turn EDI purchase orders that arrive by email into clean rows in Google Sheets. Great for operations and warehouse teams that need fast order intake without an EDI gateway. It watches Gmail, reads messages that mention EDI, and writes both order headers and line items into the right sheets.
The flow starts with a Gmail trigger that checks the subject for EDI. It pulls the email body, cleans the text, and runs a JavaScript parser that extracts header fields, partner details, dates, and each line item from EDIFACT segments. Data is flattened so each row represents one order line and is merged with order level fields. A decision step sends records to Return Orders or Outbound Orders and appends rows to specific Google Sheets tabs.
Setup needs Gmail and Google Sheets credentials in n8n. Send the sample EDI from the note to your inbox to test parsing and mapping. Expect big time savings on data entry, fewer copy paste errors, and quicker handoffs to picking and packing. Teams that receive orders by email can scale volume without adding headcount.