An event-driven automation system built for Echem to classify and process high-volume regulatory emails using GCP Pub/Sub, FastAPI, and RabbitMQ—enabling real-time ingestion, ML classification, and seamless OMS delivery.
We built a real-time, event-driven email ingestion and classification pipeline for Echem, automating the extraction and transformation of unstructured email content and attachments using GCP Pub/Sub, FastAPI, RabbitMQ, and custom ML models—ultimately enabling structured data handoff to their Order Management System (OMS).
Echem is a pharmaceutical-focused organization specializing in regulatory data exchange and research workflows. Every day they handle large volumes of structured and unstructured communications, especially email-based quotes and documentation—creating a need for a fully automated ingestion and classification pipeline.
Pharmaceuticals
Email Automation and Classification System
Comprehensive solutions designed to enhance user experience and drive business growth.
GCP Pub/Sub subscription streams new Gmail events to FastAPI.
Validates, parses, and persists incoming email data to MongoDB.
RabbitMQ-driven queues for scalable ML-based email labeling.
Marker-powered conversion of attachments into Markdown for easy downstream consumption.
Decoupled delivery of structured email data into the Order Management System via RabbitMQ.
Independently deployable services ensure high availability and future extensibility.
We identified key pain points and developed targeted solutions to transform the resort's digital presence.
Capturing each incoming Gmail message instantly and reliably, without missing or duplicating events.
Distinguishing 'Quote' emails from other correspondence and ensuring each message comes from a valid, authorized account.
Processing diverse file types (PDFs, DOCXs, images) and converting them into clean, structured Markdown.
Coordinating multiple queues (GCP Pub/Sub → FastAPI → RabbitMQ) with retry logic, back-pressure management, and health checks to prevent message loss or bottlenecks.
Orchestrating smooth data flow between GCP Pub/Sub, FastAPI services, the ML classification model, and the downstream OMS without tight coupling.
Leveraged Pub/Sub’s push model to deliver every new Gmail event directly to our FastAPI webhook, guaranteeing real‑time delivery.
Routed emails through a RabbitMQ queue feeding a custom ML service that validates sender accounts and accurately assigns labels.
Integrated a Markdown-conversion model to extract text and structure from attachments, normalizing outputs into a consistent format.
Implemented retry policies, DLQs, and health-check endpoints to ensure message durability and fault tolerance.
Decoupled each function—event ingestion, parsing, classification, and delivery—into standalone FastAPI services for scalability.
Visual highlights showcasing the transformation and key features of the new website.
Let's discuss your project and create a custom web application that drives your business forward. Get started with a free consultation today.
The email automation system drastically improved turnaround time, accuracy, and system integration while reducing repetitive human effort.
Fully automates email triage, classification, and extraction—eliminating repetitive human tasks.
Cuts the time from email receipt to actionable data by over 70%.
ML-driven classification and parser-based extraction minimize manual errors.
Plug-and-play compatibility with OMS and email infrastructure.
Structured, auditable handling of all incoming communications.