Skip to main content

PO email to draft order

This workflow watches a Gmail mailbox for purchase orders sent as a PDF and turns each one into a draft order in Propeller, with the customer, the products and the reference filled in. A sales rep gets an action to review the draft and place the order.

For requests written in the email itself, use Email to quote request.

In short
Where you use itIn the background. The results show in the Action Hub and under Sales > Orders
StartsBy itself. It checks the mailbox every minute
Changes in PropellerCreates draft orders and actions
Uses AIYes, OpenAI. It gets the text of the PDF and the names of customers and products
TextsEnglish and Dutch
Runs in n8nDepends on the number of emails
DifficultyMedium. You connect a mailbox and set who gets the actions

What you get​

A draft order with the customer, the products, the quantities, the reference and the remarks of the purchase order. The action opens the draft and names the lines that could not be matched, so you can add them yourself.

An action in the Action Hub for a draft order made from a purchase order, opened to show the number of product lines and the reference

When the workflow cannot make the order, for example because the PDF cannot be read, the action says why.

What you need​

  • An n8n account with the credential Propeller API key. See Set up n8n.
  • An API key with Owner access on User management and Order Data and Viewer access on Product Data.
  • A Gmail mailbox that only receives purchase orders. Every email with a PDF gets an action, also an invoice or a brochure.
  • An OpenAI account. You pay OpenAI per use.

How it works​

  1. AI reads the PDF and picks out the buyer, the company, the reference, the remarks and the order lines.
  2. The workflow finds the customer by the email address of the sender or one in the PDF. Without a match it searches by name and the AI picks from at most 20 customers.
  3. Each line is matched on its article number. Without a match the workflow searches the catalogue and the AI picks from at most 10 products. Quantities always come from the purchase order.
  4. The workflow creates the draft order and the action.

Propeller calculates the prices for that customer. Compare them with the prices on the purchase order.

Good to know

The workflows and agents in the Agent Hub are free to use and adapt. They are examples, not supported product features. Test them in a test environment and check the results before you use them on real customers.

Install it​

Install a workflow from the library explains each step.

  1. Import the file into n8n.
  2. Open the node Gmail Trigger and connect the mailbox.
  3. Pick your OpenAI account on the three AI nodes: Extract Order Data, Match Customer and Match Products.
  4. Check that the eight nodes that talk to Propeller use the credential Propeller API key.
  5. Open the Settings node and set the values of the table below.
  6. Send an email with a purchase order as PDF to the mailbox.
  7. Click Execute workflow to run it once.
  8. Click Publish.

After the test you find a draft order under Sales > Orders and an action in the Action Hub.

Make it yours​

SettingDefaultWhat it does
CHANNEL_ID1The channel the order is created in. The number is in the Id column under Shops & Channels > Channels
ASSIGN_TO_ADMIN_USER_IDnullThe colleague who gets the actions. The number is in the Id column under Admin > Backoffice Users
LANGUAGE'NL'The language of the product names that is used to find products
ORDER_STATUS'DRAFT_ORDER'The status the new order gets

Limits​

  • Only the first PDF of an email is read, up to 100 lines.
  • When two lines match the same product, their quantities are added up. The action lists both lines, so you can check the quantity.
  • The example is made for Gmail. For another mail provider the first node has to be replaced.