Sales & Marketing

Email Marketing & Conversation Automation

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.

system.statusemail-marketing-automation.runagent.liveworkflow.ok
Problem

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.

System architecture
  1. 01
    Data 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.

  2. 02
    First touch send

    New leads are automatically sent an initial outreach email.

  3. 03
    Inbound handling

    Replies come in through a webhook, get matched to the right conversation thread, and get logged as new messages.

  4. 04
    AI summarization

    An AI agent periodically summarizes longer conversation threads so a human can catch up in seconds instead of re reading everything.

  5. 05
    Automated follow up

    If a lead hasn't replied after a set period, an AI generated follow up is sent automatically, continuing the thread naturally.

  6. 06
    Human 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.

Result in production

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.

Who this pattern fits

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.

Keywords
  • email marketing automation
  • AI email follow up automation
  • automated lead nurture sequence
  • n8n email automation
Tools used, with role
  • 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.
What I would do differently

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.

Content angle

The five table data model behind an AI email follow up system. A technically credible piece for an audience of builders/agencies.

Frequently asked
Does this work with any email provider?+

Yes. Unipile handles sending, but the data model and logic are email provider agnostic.

More solutions

Related work