How to automate email orders into your ERP in a week (it took nine days)
An electrical wholesaler, 12 people, Comarch Optima. A sales rep took 26 minutes to retype an order from an email; the automation does it in 4 seconds. I go through it day by day, including the three things that went wrong.

An electrical wholesaler near Wrocław, 12 people, three sales reps, Comarch Optima. Orders come in by email to zamowienia@ (the orders inbox): sometimes with a PDF, sometimes as a photo of a sheet of paper, sometimes as "the same as last time, please". We timed it with a stopwatch: 26 minutes per order, from opening the email to sending the confirmation. Ten orders a day, 21 working days, that's over 90 hours a month. The owner's estimate was "a couple of hours a day". It usually comes out at twice what people think, because nobody counts switching windows and asking the customer to clarify.
What the automation actually does
- The
zamowienia@inbox is hooked up to n8n on the client's server. A new email kicks off the process within half a second. - AI reads the body and the attachment. It pulls out the customer, the line items, quantities, delivery date and notes. With "3 of what we had last time" it does this: it looks into that customer's order history in Optima, suggests the item from the last document and marks it "to be confirmed".
- It checks the VAT ID against the VAT register, the delivery address, whether the items exist in the price list, and whether this isn't a duplicate from the last 48 hours.
- It creates a ZK (a customer order document) in Optima through the API, with the discount from the customer's card.
- It sends the customer a confirmation with the order number and date, and the sales rep a short note on Teams. If anything was flagged for confirmation, the rep gets a link to the document and one question.
Tip: The first version should handle the typical orders, which at this client meant 70%. Odd formats and new customers can stay with a human, but with a ready draft from the AI instead of an empty form.
What those nine days looked like
The plan was a week. The timeline below shows what was left of it.
Day one was a review of the last 30 orders with the sales reps. We wrote down seven types of exceptions. Day two: access to the inbox (a separate technical account), access to the Optima API and the first flow on a test database. Up to this point everything was going to plan.
Day three: scans
The first real emails. Five out of thirty came as PDFs from the customer's system, and the AI read those without any trouble. Three came as photos of a sheet of paper on a warehouse table, complete with shadow and ballpoint pen. From those the AI pulled out about 60% of the lines. We added OCR before the model and accuracy jumped above 90%, but the day went on that instead of on comparisons. Photos of paper sheets are still flagged "to be checked", because 90% on a 40-line order means four mistakes.
Day four: discounts in people's heads
We compared the documents from the automation with the ones a human had entered earlier. In 11 out of 30 the prices didn't match. The automation took prices from the price list in Optima, while the sales rep knew that "Kowalski gets 7%, we agreed on that in March". That wasn't in any system. For two days the owner and the reps moved those arrangements into the customer cards. The automation had nothing to do here; we simply couldn't move on until the pricing lived in one place. In hindsight this was the most useful part of the whole project, because along the way it turned out two customers had a discount nobody could remember the reason for.
Day six: the duplicate
First week live, with manual approval of every document. A customer sent the same email twice (once from his phone, once from his computer, because "he wasn't sure it went through"). The automation politely created two ZKs. Ania from the office caught it during approval, but since that day the automation compares every new order with documents from the last 48 hours (same customer, same items, same quantity) and holds the second one back with a question.
Saturday, 3:14 am
The Optima API token expired. The email queue stopped for five hours and nobody noticed, because it was Saturday. On Monday morning five orders were waiting in the queue. Nothing terrible, but since then the token renews itself, and if nothing goes through for 15 minutes the owner gets a WhatsApp message. That alarm has gone off once since, when the internet provider was doing work on the line.
What I needed from the client
- access to the inbox through a separate technical account, with no need for the owner's password,
- access to the Optima API and a test database,
- the last 30 order emails, including the ugly ones,
- one person who approves every document during the first week. Here it was Ania, who knows the customers by name and knows that "Kowalski" is three different companies.
Efekt: After a month, 86% of orders go through untouched. The sales reps got back around 20 hours a week and, as the owner puts it, "started calling people". Quantity errors: zero in four weeks, down from three or four a week. The remaining 14% are new customers and photos of paper sheets, which still get a ready draft.
Got a similar process? Let's talk, I will work out how much of it the robots can take.
What it costs
The simple variant (email, AI, ERP, confirmation) is the Start package: a few days of work. If you add stock checks, reserving goods and invoicing, it's the Firma package. With the quote you get a second number next to it: how many hours you're giving back to the team. For this wholesaler the project paid for itself in the first month, counting time alone, without the errors and without the fact that the reps started selling again.
Free PDF: 30 processes you can automate in a week.
30 processes you can automate in a week
Free PDF: concrete processes from six areas of a company, with the time to build and the effect.
Got a process that drives you mad?
Write two sentences about what eats the most time. I will reply with what can be automated and where to start.


