AI Builder document automation, in depth
How AI Builder's document automation works — pre-built models, custom training, output structure, and the right way to integrate it with Dynamics 365.
Document automation in AI Builder turns PDF, image, and Office document inputs into structured data that flows into Power Apps, Power Automate, and Dynamics 365. It's the workhorse AI capability behind invoice processing, ID-document capture, receipt extraction, and dozens of other business automations. Understanding what it does well — and where it falls short — saves projects.
Pre-built models. Microsoft ships ready-to-use models trained on millions of documents:
- Invoice processing — extracts vendor name, address, invoice number, date, total, tax, line items, currency. Works for most standard invoice layouts in major languages.
- Receipt reader — extracts merchant, date, total, line items, payment method.
- ID reader — extracts ID number, name, date of birth, expiry from passports, driving licences, national IDs of supported countries.
- Business card reader — extracts contact data from a business card image.
- Text recognition (OCR) — generic OCR for any printed or handwritten text.
Pre-built models require no training; call them and they return structured JSON.
Custom models. When the document layout is specific (a particular vendor's invoice, a custom shipping document, a tailored expense form), you train a custom document processing model:
- Upload sample documents (typically 5–50 examples per layout).
- Tag the fields to extract — click on the value in each sample, name the field.
- Train. AI Builder processes for 10–30 minutes and emits a model with reported accuracy.
- Test on held-out samples; retrain if accuracy is low.
- Publish.
Custom models support both field-level extraction (single values like Invoice Total) and table extraction (line items with multiple columns).
Hybrid: pre-built + custom. For unusual vendor invoices that the pre-built invoice model handles poorly, train a custom model just for those vendors and route to it conditionally. Combining the two is common.
Integration with Dynamics 365. The standard pattern:
- A document arrives — uploaded to BC's Incoming Documents, dropped in a SharePoint folder, attached to a Dataverse record, or received as an email attachment.
- A Power Automate flow triggers, passes the document to an AI Builder model.
- The model returns the structured extraction.
- The flow validates, transforms, and creates the appropriate Dynamics 365 record — a draft purchase invoice in BC, a Dataverse case, an expense entry in Project Operations.
- A human reviews, corrects (the corrections feed back as model retraining data), and posts.
Output structure. Each model returns a JSON object with field names, values, and confidence scores. Flows can branch on confidence — high-confidence extractions auto-post; low-confidence go to human review.
Accuracy and feedback. Custom models report training and held-out accuracy. Real-world accuracy depends on document quality (scanned vs digital), layout consistency, and language. Build the feedback loop: every human correction is retraining data; periodic retraining keeps the model current.
Limits.
- Hand-written documents are harder than typed.
- Very poor scan quality degrades all models.
- Languages beyond the top 20 have less coverage in pre-built models.
- Very complex multi-table layouts may need pre-processing (split into pages, region-of-interest) before extraction.
Credits. AI Builder runs on a credit model — each model invocation consumes credits from the tenant's pool. Budget credits against expected volume; capacity add-ons are available.
Operational reality. Don't aim for 100% automation. Aim for 80% extraction accuracy with 20% human review; productivity gains are dramatic, edge cases stay safe.
Related guides
- AI Builder explainedMicrosoft's no-code AI model library inside the Power Platform — pre-built models, custom training, and what AI Builder is good at.
- AI prompts in Power PlatformHow AI Builder and Copilot Studio promote prompts as a first-class artefact — prompt design, parameters, grounding, and the operational patterns that make AI prompts reliable in business apps.
- Building agents with Copilot StudioHow to design Copilot Studio agents — topics vs generative answers, knowledge grounding, actions, multi-turn dialogs, and operational patterns.
- Copilot agents vs Copilot StudioHow Microsoft's agent strategy splits — Copilot Studio for building custom agents, declarative agents in Microsoft 365 Copilot, autonomous agents — and how the pieces fit together.
- Copilot Studio for Dynamics 365Building AI agents on top of Dynamics 365 with Copilot Studio — topics, knowledge sources, generative answers, and Dataverse integration.