In this article we’ll see how Google Cloud Application Integration can help automate manual processes like Purchase Order Processing for an enterprise.
Purchase order (PO) processing is a common business process that involves receiving, reviewing, and approving purchase orders from suppliers or vendors. The goal of purchase order processing is to ensure that the goods or services ordered are received in good condition and that the supplier is paid in a timely manner.
If there is no automation, vendors or suppliers usually send Purchase Orders PDFs in email as attachments and someone in the order processing (or some other department) manually downloads those PDFs to get the information like account name, opportunity Id, quote amount etc. They then need to log in to salesforce (or any other ERP System), find the account, look for the corresponding opportunities and validate the information manually.
Downsides of Manual Purchase Order Processing
The manual process for purchase order (PO) processing has several downsides, including:
Desired State with Automation
Automation with Application Integration
We are using Google Cloud Application Integration and Document AI to provide a scalable, robust and secure solution to automate this manual business process. We have used Application Integration tasks, triggers, data transformation functions, and in-built Connectors.
Document AI is used to parse the PDF; being native to GCP, the solution provides a seamless Integration with DocumentAI, making it a robust solution. As both Application Integration and Document AI are designed to scale, the solution can handle large volumes with ease.
This is the flow diagram of our solution with email as source to receive PO PDFs:
How this solution works:
Step 1: Configure a Gmail watcher to send a notification message when a new email is received in the inbox with an attachment. Send the notification to a pub-sub topic or a web-hook
Step 2: Configure the integration flow to subscribe to that topic, so as soon as there is an event, integration flow will be triggered
P.S. for each loop Gmail - Get Email Attachments calls a sub-integration
Step 3: For every attachment retrieved, the Sub-Integration is called asynchronously. In the Sub-integration, configure the gmail connector to get the message ID, use that ID to get the attachment from the email as a base64 string
Step 4: Mark the email as read/processed so the email is not read twice to avoid duplication
Step 5: The attachment encoded string is then sent to Document AI using The Doc AI - Process task. First to classify/validate if it is a valid Purchase Order and then to Extract the values
Step 6: After getting the response from the Document AI, the response is parsed in the Data Transformation task to assign those values to variables
Step 7a: Using the account name, connect to Salesforce (built-in Connector). Salesforce is queried and all the opportunities are fetched. The Opportunity Id is then validated and quotes in that opportunity are retrieved
Step 7b: If there is no valid account name, a notification email is sent
Step 8a: The Quote value is then validated and if the amount matches, and the value is less than $$$ the PDF is attached to the opportunity
Step 8a: If the amount matches, and the value is more than $$$ and approval email is sent and when it’s approved, the PDF is attached to the opportunity
Step 8c: If quote amount does not match, a notification email is sent
Document AI Processes: A custom classifier and a custom extractor
Learn how to set up:
Application Integration triggers: https://cloud.google.com/application-integration/docs/configure-api-trigger
Gmail Connector: https://cloud.google.com/integration-connectors/docs/connectors/gsc_gmail/configure
Salesforce Connector: https://cloud.google.com/integration-connectors/docs/connectors/salesforce/configure
Approval task: https://cloud.google.com/application-integration/docs/configure-approval-task
Document AI Classifier: https://cloud.google.com/document-ai/docs/custom-classifier
Document AI Extractor: https://cloud.google.com/document-ai/docs/extracting-overview
Hey @PoornimaD 😊 Thanks so much for sharing your valuable insights with the community! Your guidance is incredibly helpful. We're excited to see what new discussions this sparks.
Excellent explainer Poornima.
I'm looking forward to 2025 being the year where App Integration takes off and attains critical mass. Combined with Google's AI offerings, it's indeed a great way to orchestrate Agentic AI applications.