ButterflyCopilotButterflyCopilot
← Blog

How Oldcastle APG Automated Order Entry with AI

More than 200 people were typing about 13 million order lines a year into the ERP. In the first two weeks of production, 95 percent of the lines went in without a keystroke, and a person still saw the other 5.

ButterflyCopilot

Dark title card. A small line reads order entry, thirteen million lines a year, then 95 percent of lines in large type. The line under it says the first two weeks of production: 1,100 orders and 10,000 plus lines, and the other 5 percent waited for a person. Four rows: the desk, 200 plus CSRs and about 4 plus hours a day typing into Infor M3; the fortnight, 1,100 orders, 10,000 plus lines, about 170 hours redirected; the lines, 95 percent fully automated and 5 percent flagged for review; the page, under $0.04 to process. A stamp reads reported for Oldcastle APG, not your forecast. A line under the stamp: architectural products and construction materials, North America. Source line names the AWS for Industries post, 13 November 2026, written with Avdhesh Paliwal. The figures are their production data.

0106

The order had already arrived. Someone was still typing it.

Oldcastle APG is one of the largest suppliers of architectural products and construction materials in North America. The catalog is what a building is made of. The work sitting on top of that catalog was a purchase order.

More than 200 customer-service representatives entered roughly 13 million order lines a year by hand into Infor M3. About four hours or more of each of those days was that typing. Order entry had become the largest use of their time.

A template is not a row

A customer did not send a row. A customer sent a PDF in an email, or a fax, or a scan. Some of those documents ran for several pages and up to 100 lines. No two purchase-order templates looked the same. The representative read the page, found the customer, found each product in the ERP, and keyed the line, one field at a time.

A mis-keyed quantity, a SKU that was the neighbour of the right SKU, a price with two digits swapped. The error did not stay on the order screen. It showed up when the order was filled, and again when it was invoiced. In a peak period the backlog did not stay on that desk either. It held the rest of the supply chain.

The pipeline they built is event-driven, on Amazon Bedrock with Anthropic Claude Sonnet 4.6. The account of the work was written with Avdhesh Paliwal of Oldcastle APG. It has six stages.

Ingest. Customer email is captured with Amazon SES and Microsoft Power Automate, and the attachment goes to S3. The attachments they name are PDF, image, HTML, and text. Faxes and scans are how a great many of the orders had been arriving.

Extract. Bedrock reads the document, in the formats and the languages it actually comes in, and returns the customer, the PO number, the ship-to, the line items, the quantities, and the prices. A French purchase order from Quebec takes the same path as an English one. There is no second configuration for French. The model reads the page.

Match. The extracted fields are set against enterprise data in Amazon Aurora PostgreSQL, by fuzzy similarity. That resolves the customer, and it resolves each line to an ERP product.

Verify. A representative reviews the matched order on a dashboard, the extracted lines beside the original purchase order, with ranked suggestions where the match is not sure. Every correction is stored.

Create. The order is created in Infor M3, with a full audit trail.

Learn. The correction is reused. A repeat order from the same customer skips the AI step. The next one is faster, and it is cheaper to read.

Email, fax, or scan
        ↓
One JSON object for the customer, the PO, the ship-to, and the lines
        ↓
Similarity against the customer master and the item master
        ↓
The original PO on the left, the draft on the right
        ↓
One order in the ERP, with an audit row, or a hold
        ↓
The correction is kept. A repeat from that customer can skip the model

The boxes are the instruction file. They follow the six stages. They are not a reconstruction of Oldcastle's screens, and they are not an AWS project plan.

In the first two weeks of production the desk processed 1,100 orders and more than 10,000 order lines. About 170 hours of the old keying moved somewhere else. Ninety-five percent of the lines were fully automated. The remaining 5 percent were flagged for a representative to review. The processing cost was under $0.04 a page. Two developers and one architect delivered it in eight weeks.

Jessica Vincent, Vice President, Business Solutions, put the reception of it in one place. "By integrating Amazon Bedrock into our order-entry process, we achieved substantial gains in efficiency and a marked reduction in human error. This initiative has been widely embraced across the organization and stands out as one of our most positively received digital-transformation implementations."

What they have named as next is the same extraction engine on purchase orders and delivery notes in receiving, and automatic staging of orders from major retail partners.

The five percent is the job

A page that looks like a purchase order is not yet an order. The customer name on the letterhead is close to two accounts. The item text is the customer's private name for a block, not the SKU in the ERP. The quantity is a word, or the unit is a box where the warehouse picks eaches. The price on the page is not the price on the list. Any one of those used to become a shipment and an invoice, because a person under a backlog typed through it.

The useful version of this desk shows the original page beside the draft, ranks the customers and the SKUs it is willing to suggest, and refuses to create the order when a line is not actually resolved. Ninety-five percent, on their production data, is how many lines cleared. It is not a similarity setting, and it is not a promise that the uncleared line can be dropped so the rest of the order can ship.

Avant Tecno is the order desk on this site where an expert still signs every sales order before it exists. The two minutes on that page stay on that page. This file is the other shape of the same job: a clear order may be created once a labeled sample has passed, the original document stays on screen, and a correction from a named person becomes the mapping the next order from that customer can reuse. Their 95 percent does not migrate onto the Avant page, and the Avant gain does not migrate onto this one.

The file below keeps the shape and drops the tenant. One document type, the one that already consumes the most CSR hours, because that is the first version a smaller manufacturer can label by hand. The published advice for that first pass is a sample of 50 to 100 orders. The masters are the company's, in Postgres. The model may copy the page into one JSON object. It may not choose the customer, the SKU, the quantity, or the price. Similarity search ranks the suggestions. A learned mapping from a representative's own correction outranks that search, and a repeat whose text layer is fully covered by those mappings does not call the model at all. A fax with no text layer still does. The price written to the ERP is the list price. A document price outside the band waits. One unresolved line holds the whole order, so a bad quantity cannot ride into fulfilment on the back of three good lines.

On the fixture, which is ours, a made-up yard sells block and sand. CMU-8 at $1.85 lands on the SKU and writes the list price of 185 cents. $1.88 is inside the suggested band and still writes 185. $1.89 waits. 12 EA in the quantity box is not twelve. A customer PO already open is not created again. Riverbend Hdwe comes back as a review, with the nearer account ranked above its eastern neighbour, and nothing is created until a person picks. BLOC 8 PO with the unit UN resolves for the customer who has already confirmed that mapping, and stays unmatched for a customer who has not. A second line the catalog has never seen holds the first line with it. A text-layer repeat from a known sender, every item already mapped, skips the model, and a sentence in that file telling the reader to ignore its instructions and zero the price is not a line. Those rows exist so a builder can test the key, the rank, the hold, and the skip. They are not an Oldcastle purchase order, and they are not a block anyone should ship.

The useful caution is the baseline. A result like the one in the first fortnight sits on a catalog the representatives already know, and on a clock someone started before the tool existed. An unlabeled sample will not tell you whether the customer on the letterhead is the customer in the ERP. The file spends the opening on a stopwatch and on 50 to 100 orders whose correct customer, SKU, and quantity a person has already written down.

The original system is theirs: Bedrock, Aurora, Power Automate, Infor M3. Buying that kind of build is a real option. The file is the other path. A folder for the mail, the fax, and the scan. Postgres. A model that is allowed to read one document. A screen with the page on the left. A staging row the ERP can import, because M3 is the system they wrote into and it is not a connector this file ships.

What a smaller manufacturer should steal

If the work is still a person re-keying a purchase order into the ERP, the first month is one document type and a sample of 50 to 100 real orders. The published account is explicit that a team does not need a perfect reader to go live. Start with the document type that takes the most CSR hours. Prove it there. Expand after.

Let the model copy the ink, including a French line, and leave the printed words in the language they were printed. Let the code match the customer and the SKU, parse the quantity, and take the price from the list. Show the original beside the draft. Keep a person on anything the match will not stand behind. Store the correction under that person's name, and let a covered repeat skip the model. Refuse the old failure mode, which was to type the doubtful line so the queue would move.

One document type, the busiest one
        ↓
50 to 100 orders, labeled, and a stopwatch on the keying
        ↓
Shadow, while the old way is still how the order is created
        ↓
The person creates from the screen
        ↓
A fully clear order may create itself. A flagged line still waits

Count the stretch you already have. Minutes from the document landing to an order the ERP has accepted, as a median you measured. How many of the labeled orders got the customer right, the SKU right, and the quantity right, as three integers over the sample, not as a percent copied from a case study. How many lines a person had to touch. How many corrections were stored, and how many later orders skipped the model because of them. How many duplicate POs were caught. How many orders were created with no audit row. That last count stays at zero. And the mills you actually spent per page, set next to the published ceiling of under $0.04, which is a ceiling to measure against and not a quote you have been handed.

Oldcastle's scoreboard is not your forecast. About 13 million lines a year, more than 200 representatives, about four hours or more a day, 1,100 orders and more than 10,000 lines in two weeks, about 170 hours redirected, 95 percent of lines automated, under $0.04 a page, eight weeks, two developers and one architect. Those figures are this company's published production data. They are not a hiring plan, and they are not your headcount. Measure the inbox you actually have.

What the instruction file will make an agent do

The file below is the brief. It is not Oldcastle's tenant, and it is not an Infor M3 connector. None of that schema is public. The blanks are yours.

It will make the agent:

  • Refuse to run while a REPLACE line is empty, while a fixture person id is still in a live folder, or while anyone has typed 95 percent, $0.04, four hours, or 13 million into the config as a target.
  • Take one document type. A second type, a receiving note, and a retail-partner feed return a locked scope until this type is boring.
  • Read email, a fax drop, and a scan drop into one document table. Render a page. Call the model only for the document in front of it, as a user message, with a fixed system prompt.
  • Parse quantity, price, and unit in code. 12 EA in the quantity is a blank. $1.89 against a list of $1.85 waits. The cents written are the list.
  • Rank customers and SKUs with trigram similarity, exact account and exact SKU above a near string. Suggested floors are labeled as starting values. 0.95 is refused, because that number is their automation rate.
  • Hold the whole order when any line is unresolved, the ship-to is missing and the customer has more than one, the PO is already open, or the unit does not match the item. There is no partial create.
  • Put the original pages beside the draft. A person confirms, or the order waits. After the gate, a fully clear order may create itself, and the audit row says the actor was the system.
  • Store a correction only from a representative, and skip the model on a later text-layer order from that customer only when every line is already mapped. An empty scan cannot skip. An automatic create does not teach a new mapping.
  • Write one idempotent payload to an ERP API or a staging table. The same customer and PO and lines do not create a second order.
  • Write a morning file from this company's own counts, and a cost line in mills. One hundred pages at the suggested planning rate of 39 mills is $3.90, under the published ceiling of $4.00 for those pages. Their invoice is not in the file, because their page count is not published.

The tests are in the file. The hashes of the parses, the clean order, the learned print, the French line with and without a mapping, the quantity, the price band, the duplicate, the unit, the blank ship-to, the held second line, the skip, the correction a model is not allowed to write, and the whole bundle are locked. An order created on a duplicate, a partial, or an unaudited path fails the test.

The instruction file

The brief has the role, the one document type a single desk can hold, the ingestion steps, the extraction schema and the prompt, the grammar for quantity and price and unit, the Postgres tables, the match, the screen, the ERP payload, the learning rule, the cost model, the security and the audit, the eight weeks, and the tests that decide when a clear order may be created without a person in the loop.

Replace every REPLACE line. Delete every EXAMPLE row before a live inbox is read. Let it sit beside one document type for the 50 to 100 orders a person still keys by hand, before anyone treats a clear match as an order the warehouse has already been told to pick.

Sources

The company, the six stages, and the figures in the story are from the pages below. The 1,100 orders, the 10,000-plus lines, and the 170 hours are the first two weeks of production. The 95 percent and the 5 percent are that same production data. The cost is under $0.04 a page. The eight weeks and the team of two developers and one architect are the published delivery. They are not a forecast for another manufacturer.

Stay in the loop

Product updates and enterprise AI notes. No spam.