Microsoft Outlook → OpenAI → SAP Business One
Apps Required
A scheduled trigger monitors a Microsoft Outlook inbox every three minutes for emails arriving from a designated trading partner address. Each qualifying email—including its subject, sender, and message ID—is forwarded for attachment extraction.
The workflow retrieves all attachments from the incoming email and splits them into individual items using a splitter node. Each attachment's base64-encoded content is prepared separately so that every file can be evaluated independently for EDI content.
Each attachment is sent to OpenAI (GPT-4.1) with a structured prompt that determines whether the content is a valid EDI 850 purchase order. If it is, the AI extracts all relevant fields—sender number, customer reference, expected delivery date, and line items with item codes, quantities, unit prices, and UPC codes—and returns them in a strict JSON schema. The response is then converted from string to structured JSON for downstream use.
A filter node passes only attachments confirmed as valid EDI files (EDI_FILE = Yes). For each valid order, a quotation is created in SAP Business One using the parsed sender number as the customer code, the expected delivery date, and all line items with their item codes and quantities. This quotation serves as a price validation baseline against SAP's master pricing.
A second OpenAI call compares the original EDI order line items and prices against the SAP quotation's document lines. The AI checks whether all line items are present in the quotation and whether the prices match. If discrepancies exist, the mismatch amount is calculated. The result is converted to JSON and passed to a decision node.
A decision node evaluates whether all line items are present and all prices match. If both conditions are met, the workflow routes to the acceptance path to create a live sales order. If either condition fails, the workflow routes to the rejection path to notify the sender of the discrepancy.
On the match path, a sales order is created in SAP Business One with today's date, the parsed customer code, delivery date, and full line item detail. OpenAI then generates a compliant X12 EDI 855 Purchase Order Acknowledgement with acceptance code (BAK purpose 00, type AD) referencing the SAP document number. The 855 response is converted to JSON and emailed back to the original sender via Outlook as a successful acknowledgement.
On the mismatch path, OpenAI generates an X12 EDI 855 rejection response citing the price mismatch amount and referencing the SAP quotation document number. The rejection EDI is converted to JSON and sent back to the original email sender via Outlook, giving the trading partner clear visibility into why the order was not accepted.
| Modules | Trigger |
|---|---|
| Get inbox emails | Fetch emails from Outlook Inbox |
| Get messages | List mail messages filtered by receivedDateTime range. |
| Get inbox email for a specific sender email | Fetch emails from Outlook Inbox filtered by sender email address. |
Purchase orders arriving as EDI 850 email attachments are automatically parsed, validated, and entered into SAP Business One as sales orders—eliminating manual data entry and reducing order processing time from hours to minutes.
1
2
Every incoming EDI order is cross-checked against SAP Business One pricing by creating a temporary quotation. Price mismatches are caught automatically before the order is committed, preventing revenue leakage from incorrect pricing.
Trading partners receive compliant X12 855 acknowledgements—acceptance or rejection—automatically via email, keeping the EDI communication loop closed without any manual intervention.
3
4
Every step—from email receipt and AI parsing through price validation to order creation—is tracked, providing a clear audit trail that links the original EDI attachment to the final SAP Business One sales order or rejection.
1
Purchase orders arriving as EDI 850 email attachments are automatically parsed, validated, and entered into SAP Business One as sales orders—eliminating manual data entry and reducing order processing time from hours to minutes.
2
Every incoming EDI order is cross-checked against SAP Business One pricing by creating a temporary quotation. Price mismatches are caught automatically before the order is committed, preventing revenue leakage from incorrect pricing.
3
Trading partners receive compliant X12 855 acknowledgements—acceptance or rejection—automatically via email, keeping the EDI communication loop closed without any manual intervention.
4
Every step—from email receipt and AI parsing through price validation to order creation—is tracked, providing a clear audit trail that links the original EDI attachment to the final SAP Business One sales order or rejection.
Common questions about this automation template.
Automate smarter with an AI-native platform designed for the way mid-market businesses really work.