Introduction
In this test drive, you will explore how CloudFiles Document AI integrated with Salesforce Flows can automatically process business documents β such as Purchase Orders, Invoices, Quotes, or any other structured document β and intelligently extract key information.
Refer to the below video to understand what to expect in this test drive -
The setup will:
- Automatically identify the type of document (PO, Invoice, Quote, etc.)
- Extract important fields like Document Number, Document Date, Total Amount, Company Name, and a Document Description
- If the document contains Line Items, it will parse and create child Line Item records linked to the parent Business Document record
The entire flow is automated using CloudFiles Document AI and Salesforce automation. This test drive takes less than a minute to complete.
Instructions
Follow the steps below to test the setup:
- Go to the Business Documents tab and create a new record. No additional input is required β just save it.
- Upload a document (Purchase Order, Invoice, Quote, or other) into the Files related list in any format (PDF, DOCX, or image).
- Wait a few seconds for automation to trigger. Refresh the page to see the updates.
- Check AI Output
- CloudFiles AI will classify the document and update the Document Type field to one of: Purchase Order, Invoice, Quote, or Other.
- Other fields such as Document Number, Document Date, Total Amount, Company and Document Decsription will also be auto-populated on the Business Document record.
- If the document includes line items (e.g., from a PO or Invoice), you will see related Line Item records created showing Item Name, Quantity, Unit Price, and Line Amount.

Optional: Process External Files
If you want to see how CloudFiles Document Management & Sharing works alongside Document AI to process external files, like sharepoint files, upload the documents via the CloudFiles widget in External Files tab of the record. (If don't see a folder connected in the widget, simply refresh the widget or the page)

Implementation
This demo is powered by Salesforce Flows with the following: Salesforce File Attached, Process Document using AI and Query Document/Dataset. CloudFiles Document AI handles classification, summarization, and extraction, while a Platform Event triggers updates once processing is complete.

For more information, please refer to Document AI Tutorials, Batching AI Queries and Line Item Extraction.
Beyond This Test Drive
This demo showcases a single workflow, but the capabilities of CloudFiles Document AI extend far beyond simple classification and extraction. By combining AI-powered document understanding with Salesforce automation, you can build scalable, intelligent workflows across departments.
Here are a few advanced applications:
Contract Intelligence & Summarization
Summarize contracts and extract key obligations, renewal dates, or termination clauses.
Example: When a new vendor contract is uploaded, Salesforce fields are auto-updated with renewal reminders and risk tags, and routed for approval.
Complex Table & Form Parsing
Handle semi-structured forms such as insurance claims, compliance reports, or regulatory filings.
Example: Multi-page compliance reports are parsed, and each section is stored as structured data linked to the appropriate Salesforce object.
Document Type Routing & Workflow Triggers
Use document type and extracted fields to direct files into the correct process.
Example: Invoices are routed to Finance, contracts to Legal, and POs to Procurement β all automatically, based on classification and metadata.
Validate Document Calculations
Go beyond extraction by checking math and consistency inside uploaded documents.
Example: AI verifies that Invoice Total = Ξ£(Line Item Amounts + Taxes). If thereβs a mismatch, Salesforce can automatically flag the document for review.
Cross-Check Against Salesforce Data
Compare extracted fields with existing Salesforce records to detect discrepancies.
Example: A vendorβs submitted PO is validated against the Opportunity or Quote in Salesforce β if item prices, totals, or dates donβt align, a discrepancy alert is generated.
File-to-File Line Item Matching
Identify mismatches between related documents uploaded at different times.
Example: Compare a customer Quote and their later submitted Purchase Order. If quantities or unit prices differ, Salesforce can notify the sales team before fulfilment.
Fraud & Error Detection
Detect duplicate or inconsistent records across files.
Example: AI flags when the same invoice number appears twice from the same vendor, preventing double payment.
End-to-End Order Reconciliation
Automate reconciliation between Quotes, POs, Invoices, and Delivery Notes.
Example: Salesforce Flows compare extracted line items across all related documents, ensuring that what was promised in the Quote matches what was ordered, invoiced, and shipped.
For more advanced configurations, tutorials and ideas, visit Document AI Tutorials.
Let CloudFiles Document AI + Salesforce work together to make your document processing workflows intelligent, fast and scalable.