Following up with inbound leads by email consistently, at scale, without losing context of ongoing conversations, is hard to do manually across many leads at once.
- 01Data model
A five table structure separates leads, contacts, conversations, messages, and events, so the system can track not just 'was an email sent' but the full back and forth history per contact.
- 02First touch send
New leads are automatically sent an initial outreach email.
- 03Inbound handling
Replies come in through a webhook, get matched to the right conversation thread, and get logged as new messages.
- 04AI summarization
An AI agent periodically summarizes longer conversation threads so a human can catch up in seconds instead of re reading everything.
- 05Automated follow up
If a lead hasn't replied after a set period, an AI generated follow up is sent automatically, continuing the thread naturally.
- 06Human handoff
Conversations that need a real person (complex questions, ready to close leads) are flagged and handed off, and closed conversations are marked as such to stop further automated messages.
Every lead gets timely, contextual follow up without a person having to track each conversation manually, while still being pulled in exactly when a human touch is needed.
Originally built for the sales & marketing, the same architecture applies to any team facing a similar volume, compliance, or coordination problem. The stack (n8n, Unipile, Supabase, and others) is stable, self hosted where it matters, and designed to be operated by a small team without a platform crew.
- email marketing automation
- AI email follow up automation
- automated lead nurture sequence
- n8n email automation
- n8nWorkflow runtime and orchestration. Every scheduled job, webhook, and branch lives here so the logic is version controlled and observable.
- UnipilePart of the production stack for this build.
- SupabasePostgres, auth, and storage. Holds the source of truth for records the workflows read and write.
- Claude APIReasoning and structured outputs. The default LLM for anything that needs to be trusted in production.
I would separate the enrichment pipeline from the sending pipeline more strictly. Coupling them made it too easy for a bad enrichment run to poison outreach quality for a day.
The five table data model behind an AI email follow up system. A technically credible piece for an audience of builders/agencies.
Does this work with any email provider?+
Yes. Unipile handles sending, but the data model and logic are email provider agnostic.