Email-to-Structured-Data Automation
Built a lightweight automation system integrating email parsing and structured data processing for operational efficiency. Handles rule-based routing with configurable triggers.
A small internal tool that turned a messy email-based workflow into structured data and predictable routing.
Problem
Incoming requests and notifications were landing in a shared inbox. Triage was manual, and nothing was consistently logged or routable. We needed a way to:
- Ingest specific emails (by address, subject, or label)
- Parse key fields (sender, dates, identifiers) into a consistent shape
- Route records into our internal tools and logs
Without buying into a heavy platform or a full-blown CRM.
Approach
- Ingest: IMAP polling (could be swapped for webhooks if the provider supports it). Only processes mail that matches simple rules (e.g. subject prefix, sender list).
- Parse: Lightweight extraction with regex and a small schema. Output is JSON that matches our internal record type. No NLP—we control the email templates so pattern-based parsing is enough.
- Route: Rule-based. If field X matches, send to queue A or write to sheet B. Config is data (YAML/JSON), not code.
- Stack: TypeScript, Node, minimal dependencies. Runs as a single process; we can scale by sharding mailboxes or moving to a queue if needed.
Outcome
We went from "check the inbox and copy-paste into the tool" to "inbox is ingested; records show up in the right place." Build time was a few days. No database beyond what we already had; the automation is stateless and idempotent where it matters. Good fit for a small team that needs reliability over features.