Email marketing automation with AI follow-up and human handoff
A follow-up system that keeps each lead's email conversation in context and brings in a person when judgement is needed.
The problem
Following up consistently with many inbound leads by email is hard at scale. Tracking the context of each conversation by hand, across many threads at once, needs someone watching every one.
How the system works
Data model
Five tables hold leads, contacts, conversations, messages and events separately. This keeps the full interaction history instead of just recording whether an email was sent.
First touch
A new prospect automatically receives an opening message when they enter the system.
Inbound handling
Replies arrive by webhook, are matched to the right conversation thread and stored as further messages in it.
AI summarisation
An AI agent periodically condenses long threads so a human reviewer can grasp the context without reading the whole exchange.
Automated follow-up
When a lead stays silent past a set time, the system writes and sends a suitable follow-up that keeps the conversation natural.
Human handoff
Conversations that need judgement, such as complex questions or sales-ready leads, are flagged and passed to a team member. Resolved conversations stop receiving automated messages.
Result in production
Every lead gets timely, contextual follow-up without a person tracking each conversation manually, and a human is brought in exactly when needed.
Who this pattern fits
We built it for sales and marketing, but the approach fits any department managing similar volumes and coordination. The stack runs independently, is stable and suits small teams without dedicated platform engineers.
Tools used
n8n
Workflow runtime and orchestration; every scheduled job, webhook and branch lives here.
Unipile
Handles the sending of messages in production.
Supabase
PostgreSQL database, authentication and storage as the authoritative record.
Claude API
Reasoning and structured outputs; our default model for anything that has to be trusted.
Related
Frequently asked questions
Does this work with any email provider?
Yes. Unipile handles the sending, while the data model and the logic around it do not depend on a particular provider.