Challenge: Customer order requests arrived as emails with PDF, Excel, and scanned attachments. CSR teams read each document manually, extracted the required details, and re-entered them into Deposco, the warehouse management system.
Order formats were never consistent. Some customers sent structured purchase order templates, others sent freeform email bodies with spreadsheets attached, others used legacy ERP documents with inconsistent layouts. A single rigid parser could not cover them.
The consequences were predictable:
- Manual transcription introduced errors in quantities, SKUs, addresses, and delivery dates.
- Each order required a CSR to open the email, read the document, and type the details into Deposco. During peak periods, orders queued.
- Order volume growth meant hiring more CSR staff or accepting longer processing times.
- Follow-up requests made it worse. "Change the quantity to 250 for the order we sent last week" required finding the right order before anything could be corrected.
The team needed automation that could handle format variability without putting incorrect orders into the system of record.
Solution
We built an automated pipeline from email inbox to WMS order creation, then extended it with an agent layer to handle the cases that need investigation.
Step 1: Capture Inbound Orders
Microsoft Graph captures email events, message content, metadata, and attachments from the orders inbox. Google Cloud Functions orchestrate the workflow and store source documents in Google Cloud Storage.
Landing raw documents in cloud storage decouples ingestion from extraction, so the AI logic can be updated without touching the email integration.
Step 2: Extract and Structure the Data
An AI extraction step reads each document, applies customer-specific rules, and maps the output into the Deposco API structure. Rather than relying on fixed field positions, extraction adapts per sender, recognizing the labels and layout patterns each customer uses.
Step 3: Validate Before Writing
Deterministic rules run before anything reaches Deposco: required fields, customer and SKU checks, unit of measure, duplicates, and confidence thresholds.
Orders that pass are created in Deposco and written to Snowflake. Orders that fail are routed to the RBW team as exceptions rather than being guessed at. This is what makes the pipeline safe to run against a live WMS.

Step 4: Add Agents for the Hard Cases
Straightforward insertions were the easy half. Follow-ups, modifications, and unclear references still required a CSR to investigate before anything could be entered.
We added a hierarchy of LangGraph agents, each with a narrow job:
- Intake agent: decides whether an incoming event is order-related and routes it to the right flow. Junk and unrelated mail stops here.
- Task supervisor: interprets the event, splits it into tasks, assigns them to subagents, and decides when the RBW team needs to be informed.
- Task-carrier subagents: each handles one action, with read access to the inbox, Deposco and its documentation, Snowflake, the customer list, and a customer knowledge base covering contact details, document formats, and business unit rules.
- Order creator/editor tool: the only path to a write. It applies validation before posting to Deposco, returns errors to the subagent for interpretation, and updates Snowflake.
The agents investigate and recommend. The validation rules and the write tool decide what actually changes.

Taking the earlier example: a customer emails "Please change the quantity to 250 for the order we sent last week." The intake agent recognizes an order event. The supervisor dispatches a task carrier, which searches the email thread, the customer knowledge base, and Deposco to determine which customer sent it, which order matches the thread, PO, SKU, and sender, and whether that order has already shipped. If exactly one order matches and the quantity is valid, the write tool posts the update. If anything is unclear, the case goes to the RBW team with the evidence already gathered.
Human Review Layer
Orders created through the pipeline land in Deposco with a review flag. CSR staff verify the extracted data before the order moves into fulfillment.
Instead of reading documents and typing data, the team reviews pre-populated orders and handles exceptions. This is faster, less error-prone, and scales without headcount.
Results
The extraction and insertion flow is live in production. The agent layer is built and rolling out behind it.
- Live across three customers, each with different document formats and ordering conventions.
- More than 100 orders inserted automatically, with no manual data entry.
- Zero incorrect orders released to fulfillment. Documents that failed extraction or validation were caught and escalated rather than guessed at.
- Successful and failed orders are both written to Snowflake and tracked in a Power BI report covering processed volume, error distribution, and per-customer breakdown.
| Metric | Manual process | Automated process |
|---|---|---|
| Order entry | CSR types into Deposco | AI extracts, CSR reviews |
| Ambiguous requests | CSR investigates | Agent investigates |
| Scaling | With headcount | With compute |
| Audit trail | None | Every order logged |
Key Takeaways
Format variability is the real problem. The reason manual entry persisted was not volume, it was that every customer sends orders differently. Customer-specific extraction rules, not a single parser, are what made automation possible.
Agents investigate, rules decide. Letting an AI model write directly to a WMS trades a data entry problem for a data integrity problem. Separating investigation from the write path is what allows automation to expand without loosening control.
Exceptions are a feature. Every escalated case is logged and reportable, which shows where the next rule or extraction improvement belongs. Failures that route to a human are cheaper than errors that reach fulfillment.
Next Steps
- Finalize confidence thresholds and monitoring ahead of full agentic sign-off.
- Scale to additional customers and higher order volumes.
- Expand document coverage across edge cases: handwritten notes, multi-page orders, non-standard SKU formats.
- Tighten integration with operational review workflows to shorten the gap between order receipt and fulfillment start.
Technologies and Tools
Python, Microsoft Graph, Google Cloud Functions, Google Cloud Storage, OpenAI API, LangGraph, LangChain, MongoDB, Snowflake, Deposco API, Power BI



