Skip to content
Apsan Works
Internal2025–2026

Email Automator

A multi-step email outreach engine (sequencing, A/B variants, send-window throttling) with an MCP interface so an AI agent can operate it directly.

The problem

Outreach at any real volume is a scheduling problem wearing a marketing hat. Sending too fast burns the sending account; sending on a rigid timer ignores that a reply changes what should happen next; and a sequence built for one lead has to behave correctly for thousands running through it at different stages simultaneously. Most of the engineering is in getting that state machine right, not in writing better subject lines.

What we built

  • 01

    Multi-step sequences with A/B variants per step. Each lead's assigned group determines which variant sends, with automatic fallback when a step has no B variant defined yet.

  • 02

    A merge-tag resolver that is case- and format-tolerant, so [First Name], [first_name], and [FIRST NAME] all resolve the same way rather than failing silently on a mismatch.

  • 03

    Send-window and rate-limit enforcement: per-account daily caps, weekday-only sending, configurable sending hours, and a cooldown before retrying a lead after a transient failure.

  • 04

    Two independent lead-sourcing paths fed into the same pipeline: a Google Maps scraper for local businesses, and a SAM.gov API integration for federally-registered SDVOSB firms.

  • 05

    An MCP server exposing templates, leads, and send actions as tools, so an AI agent can inspect and operate the whole system directly rather than through a UI.

Decisions worth noting

State machine over cleverness

The hard problem here was never generating text. It was correctly tracking where each of thousands of leads sits in a multi-step sequence, and what is safe to do next. That state lives in SQLite, not in memory, so it survives restarts.

An MCP server as the control surface

Templates, leads, and send actions are exposed as MCP tools, so an AI agent can query and operate the outreach system the same way a person would through the dashboard. A real agent interface, not a chat wrapper around one.

Two lead sources, one schema

Google Maps and SAM.gov return completely different shapes of data. Both normalise into the same lead record before they ever reach a sequence, so the sending logic never has to know which source a lead came from.

Tell us what is slowing you down

A short conversation is usually enough to tell whether this is a build, an automation, or something you should not do at all. We will tell you which.