Documentation Index
Fetch the complete documentation index at: https://docs.duvo.ai/llms.txt
Use this file to discover all available pages before exploring further.
| Time to complete | 30 minutes |
| Difficulty | Intermediate |
| Prerequisites | Gmail or Outlook connection, access to your order management system |
| You’ll build | An assignment that reads incoming order emails, extracts structured data, writes records, and flags anomalies for review |
Why Automate This?
The Problem: Orders land in a shared inbox —orders@company.com — and someone has to open each one, read the body and any attachments, type the data into your order management system, and check for errors. This takes hours every day. Mistakes happen. Orders get missed when volume spikes. Late or duplicate entries delay fulfillment and frustrate customers.
The Solution: A Duvo assignment that monitors your shared inbox, reads each order email and its attachments, extracts structured fields, validates them, and writes a clean order record into your system. When something is ambiguous or looks wrong — a missing SKU, a customer that doesn’t exist, a quantity outside normal range — the assignment flags it for a human to review rather than silently creating a bad record.
Expected Results:
- Eliminate manual rekeying for routine orders
- Catch anomalies before they reach fulfillment
- Reduce order entry time from minutes per order to seconds
- Complete audit trail of every order received and processed
What You’ll Build
By the end of this playbook, you’ll have an assignment that:- Watches your orders inbox for new emails matching your order pattern
- Reads the email body, PDF attachments, and spreadsheet attachments to extract order fields
- Looks up whether the customer and SKUs are known in your system
- Checks quantities against configured bounds
- Detects duplicate orders for the same reference number
- Writes valid orders directly into your order management system
- Pauses for human review on any order with missing, ambiguous, or out-of-range fields
- Sends the sender a confirmation or a clarification request once the order is resolved
- Gmail or Outlook — read the shared inbox
- Email Attachments Reader — extract data from PDF, Excel, and image attachments
- Intelligent Document Reader — parse unstructured PDF order forms
- Your order management system — write records (Salesforce, NetSuite, SAP, Google Sheets, or your ERP)
- Human-in-the-Loop — pause for review on anomalies
Before You Start
Make sure you have these ready:- Shared inbox access — A Gmail or Outlook account for
orders@company.com(or equivalent). Connect Gmail or Connect Outlook. - Order system login — Credentials with read and write access to your order management system. Store logins securely.
- Sample order emails — A few real (anonymized) order emails with attachments. You’ll use these for testing in Step 9.
- Field list — Know which fields your order system expects: customer ID or name, line items (SKU, quantity, unit price), PO number, requested delivery date, and any custom fields.
- Valid customer and SKU lists — Either accessible in your order system via API, or exportable as a CSV you can upload to Files. Used for validation in Step 6.
Step 1: Create Your Assignment
- Click ”+ Create Assignment” from your dashboard.
- Select “Use Assignment Builder”.

Step 2: Describe Your Workflow
Paste this prompt into the Assignment Builder and replace the bracketed placeholders with your specifics:Step 3: Review Generated SOP
Duvo will generate a structured SOP from your description. Before continuing, confirm:- Your order system name appears correctly in the SOP.
- The validation rules reflect your actual business rules (customer lookup method, SKU format, quantity bounds).
- The anomaly escalation matches how your team wants to handle exceptions — approve and correct, or bounce back to the sender.
Step 4: Configure Connections
Click “Connections” and add:- Gmail or Outlook — The shared inbox account. If the account is not yours personally, you may need an admin to authorize it.
- Email Attachments Reader — Already available by default; no additional setup required.
- Intelligent Document Reader — Already available by default; handles unstructured PDF forms.
- Order system — Add the login or API credentials for your ERP, CRM, or spreadsheet. See My Logins for how to store credentials securely.
- Human-in-the-Loop — Already available by default.
Step 5: Handle Multi-Attachment Orders
Orders often arrive with more than one attachment — for example, a PDF purchase order form and an Excel spreadsheet listing line items. Update your SOP to handle this explicitly:Step 6: Set Up Validation Rules
Add explicit validation to the SOP to prevent bad records from reaching your order system. Tailor these examples to your business:Step 7: Write the SOP for HITL Review
When an anomaly occurs, the assignment pauses and sends a Human-in-the-Loop approval request. Tell the SOP exactly what information to include and what to do with the response:Step 8: Configure the Inbox Trigger
Set the assignment to run automatically when new order emails arrive:- Go to Assignment Settings > Schedule.
- Select Event-driven trigger.
- Set the trigger to “New email” in your connected inbox.
- Add a filter so the assignment only runs on emails that look like orders — for example, emails with “order” or “PO” in the subject, or emails to a specific inbox alias.
Step 9: Test with Sample Orders
Before going live, run tests against real-world order scenarios:- Click “Start Work” to run the assignment manually.
- Send test emails to your inbox covering these cases:
| Test case | What to verify |
|---|---|
| Clean order — email body only | Fields extracted correctly, record created, confirmation sent |
| Clean order — PDF attachment | PDF parsed, all fields extracted, record created |
| Clean order — Excel line items | Spreadsheet read, all line items extracted, record created |
| PDF + spreadsheet together | Both read, data merged correctly |
| Unknown SKU | Anomaly flagged, HITL request sent, record not created |
| Unknown customer | Anomaly flagged, clarification email sent to sender after rejection |
| Duplicate reference number | Duplicate detected, flagged for review |
| Missing delivery date | Anomaly flagged if delivery date is required; record created if optional |

Step 10: Write to Your Order System
The method the assignment uses to create the order record depends on your system: API-connected systems (Salesforce, NetSuite, HubSpot, Supabase) The assignment calls the system’s API directly. Confirm write permissions are granted to the credentials you added in Step 4. Spreadsheet-based systems (Google Sheets, Excel) The assignment appends a new row per order. Upload your column headers as a Files file so the assignment knows the schema. See Google Sheets or Microsoft Excel. Web-only systems (browser-based ERPs) The assignment navigates the system using Computer Use — it opens the browser, logs in, fills in the order form, and submits. Add this to your SOP:Expected Results
When your assignment is running successfully: In your inbox:- Sender receives a confirmation email for every clean order, referencing the PO number.
- Sender receives a clarification request for rejected anomalies, listing exactly what needs correcting.
- A new order record for each valid email, with all extracted fields populated.
- No partial or incorrect records — anomalies are held for human review before being written.
- Pending Human-in-the-Loop requests for each anomalous order, with the extracted data and the specific issue clearly described.
- A complete session log for each job, showing each extraction step, validation outcome, and write action.
Troubleshooting
Assignment does not pick up new emails
- Trigger filter: If you added a subject-line filter, verify the filter matches the exact wording of your order emails. Try broadening or removing the filter temporarily.
- Authorization: Re-authorize the Gmail or Outlook connection if the session has expired.
- Batch mode: If you are using a schedule instead of an event trigger, orders will accumulate until the next scheduled run.
Attachment extraction is incomplete or incorrect
- PDF quality: Scanned PDFs with low resolution or heavy formatting can reduce extraction accuracy. Ask senders to provide native PDFs where possible.
- Spreadsheet format: The assignment reads the first sheet by default. Add a note to your SOP if the data is on a different sheet:
"Line items are on the sheet named 'Order Lines'." - Multi-page PDFs: Long PO forms spanning many pages are supported. If only the first page is extracted, explicitly state in your SOP:
"Read all pages of the PDF attachment."
Validation is flagging too many false positives
- Customer name matching: Senders may spell customer names slightly differently. Update your SOP to instruct the assignment to match on customer ID rather than name, or to accept close matches (e.g., “Acme Corp.” and “ACME Corporation” are the same customer).
- SKU formatting: Check that the SKU format from the email (e.g.,
SKU-12345) matches what is stored in your order system (e.g.,12345). Add a normalization step to the SOP if needed. - Quantity bounds: If your maximum is set too low, adjust it to reflect your realistic order volumes.
Duplicate detection creates false positives
- Reference number format: Some customers reuse PO numbers across periods. Narrow the deduplication window:
"Check for duplicates received in the last 7 days"instead of 30. - Blanket orders: Customers with standing orders may legitimately send the same reference number. Add an exception rule:
"Treat emails from [blanket-order-customer@example.com] as always unique regardless of reference number."
Order system write fails
- Permissions: Confirm the login has create/write access, not just read.
- Required fields: Your order system may reject records missing mandatory fields. Identify which fields are required and add them to the validation step so orders are flagged before a write is attempted.
- Rate limits: If processing a large backlog of emails at once, add a short pause between record creation calls:
"Wait 2 seconds between each order creation."
Take It Further
Once your basic assignment is processing clean orders reliably, consider these enhancements: Add delivery-date prioritizationRelated
- Human-in-the-Loop — How to design effective approval gates for anomaly review
- Event-Driven Triggers — How to run the assignment automatically when a new email arrives
- Email Attachments Reader — Extracts data from PDFs, spreadsheets, and image attachments
- Intelligent Document Reader — Parses unstructured document formats
- Computer Use — For writing to UI-only systems: browser automation for web ERPs, remote desktop for SAP GUI and legacy desktop clients
- My Logins — Store order system credentials securely
- Purchase Order Processing — Related example for PO approval workflows