AI Nurture Sequence Generation Engine
AI Nurture Sequence Generation Engine
Introduced in v1.0.14
When an agent assigns a contact to a category, NurtureHub automatically generates a personalised 3-email nurture sequence in the background. The sequence is written in the agency's own brand voice, stored as drafts, and the agent is notified when it's ready to review — no workflow building, no manual writing required.
How It Works
1. Trigger: Contact Category Assignment
Every time a contact is assigned to one of NurtureHub's twelve predefined categories (e.g. Seller, Landlord, Buy-to-Let Investor, Active Tenant), an Inngest background function is automatically triggered. This happens asynchronously — the agent sees no delay in the UI.
2. AI Generation
The background function calls the OpenAI API using two key inputs:
- The organisation's brand voice profile — captured during onboarding, this defines the agency's tone, style, and preferred language.
- The contact's assigned category — this determines the content focus, relevant calls-to-action, and appropriate messaging angle for all three emails.
The function generates a complete 3-email nurture sequence. Each email includes:
| Field | Description |
|---|---|
subject | The email subject line |
html_body | Full HTML-formatted email body |
text_body | Plain-text fallback body |
3. Storage
All generated emails are written to the sequence_emails table with a status of draft. They are held there until an agent reviews and approves them — nothing is sent automatically.
4. Agent Notification
Once the sequence has been generated and saved, a notification is sent to the agent who assigned the category. This prompts them to open the sequence, review each email, and approve or edit before scheduling.
Reliability
Retries
The Inngest function includes automatic retry logic. If the OpenAI API call fails due to a transient error (rate limit, timeout, network issue), the function retries automatically without any manual intervention.
Token-Limit Chunking
Organisations with long brand voice profiles or detailed contact records could exceed OpenAI's token limits. The function handles this by chunking the input data to stay within safe limits, ensuring generation succeeds regardless of data volume.
Graceful Degradation
If generation fails after all retries are exhausted, the function degrades gracefully. The contact and any existing data remain in a consistent state, and no partial or corrupted sequences are written.
Contact Categories
The AI generation engine supports all twelve NurtureHub contact categories. The category determines the email content strategy:
- Seller
- Landlord
- Buy-to-Let Investor
- Active Tenant
- (and eight additional categories)
Each category produces distinct subject lines, body content, and calls-to-action relevant to that contact type.
Sequence Email Lifecycle
Contact assigned category
│
▼
Inngest function triggered (async)
│
▼
OpenAI API called with brand voice + category
│
▼
3 emails generated (subject, HTML body, text body)
│
▼
Stored in sequence_emails (status: draft)
│
▼
Agent notified → reviews and approves