# Workflow Specifications

All workflows: **OFF / draft** until Nazim approves exact test activation. Fake test contacts only. Sender: `GAP (D5)`. Active email copy: `Email Copy.md` (E0, E1, E2, U1–U3, E5–E7). E3/E4 are retained as inactive Day 10 reference variants. Timings marked `ASSUMPTION`.

**Guideline alignment note:** the supplied `Pareto_FinalProject_Guidelines.md.docx` is the submission authority for this revision. It requires two qualified follow-ups and three unqualified nurture emails. The Day 10 slides/transcript describe three qualified follow-ups and one unqualified delivery email; that earlier version is preserved as a documented discrepancy, not the active strict-guidelines sequence.

Global settings for every workflow:
- Allow re-entry: **Off** (prevents loops and duplicate sequences).
- Stop on response: On for nurture emails.
- Send only if `email_consent = true` and the email is valid.
- Quiet hours: send 8:00 AM–6:00 PM contact time (`ASSUMPTION`).

## WF1 — Opt-in (all submissions)

| | |
|---|---|
| Trigger | Form submitted: Handoff Plan form |
| Filters | None (every completed submission) |

| Step | Action |
|---|---|
| 1 | Create/update contact; save all custom and hidden fields |
| 2 | Add tag `lm-handoff-plan` |
| 3 | If `previous_assistant = failed` → add `prev-va-failed` |
| 4 | Compute tier (Low → High → Potential, see CRM map); set `fit_tier`; add matching `fit-*` tag (remove others) |
| 5 | Create/update opportunity in "Handoff Plan Lead Magnet": stage **Opted In** |
| 6 | If high → move to **Qualified**. If potential/low → move to **Unqualified Leads** |
| 7 | Send **E0 Plan delivery** immediately (all tiers) |
| 8 | Internal notification **N1** to the Pareto team inbox (GAP: address) |
| 9 | Branch: high → add to WF2; potential/low → WF3 |

Failure paths: email bounce → tag `email-bounced`, notify team, no further emails. Missing `handoff_top_1` (app hand-off failed) → still send E0 with generic wording (`{{contact.handoff_top_1|default:"your top task"}}`) and flag `handoff-missing` for review.

Redirect (form setting, not workflow): high → booking page; others → thank-you page.

## WF2 — High-fit follow-up (2 value + booking-nudge emails)

| | |
|---|---|
| Trigger | Added from WF1 (tier = high) |
| Goal / exit | Tag `call-booked` added → **exit immediately** |

| Step | Wait | Action |
|---|---|---|
| 1 | 1 day | If not `call-booked` → send **E1** |
| 2 | 2 days (day 3) | If not `call-booked` → send **E2** (Burned Buyer paragraph if `prev-va-failed`) |
| 3 | — | End. Opportunity stays in Qualified for manual follow-up |

## WF3 — Unqualified nurture (3 emails after delivery)

| | |
|---|---|
| Trigger | Added from WF1 (tier = potential or low) |

| Step | Wait | Action |
|---|---|---|
| 1 | 2 days | If consent remains true → send **U1** |
| 2 | 3 days later (day 5) | If consent remains true → send **U2** |
| 3 | 4 days later (day 9) | If consent remains true → send **U3**, then end |

The unqualified sequence is educational and does not use a booking CTA. It preserves the low-fit no-sales-push rule while satisfying the guideline's three-email nurture requirement.

## WF5 — Booking confirmation and reminder

| | |
|---|---|
| Trigger | Appointment booked on **Pareto Talent Right Hand Discovery Call** (mock calendar, test location only) |

| Step | Wait | Action |
|---|---|---|
| 1 | — | Add tag `call-booked` (this exits WF2) |
| 2 | — | Move opportunity to **Call Booked** |
| 3 | — | Send **E5 Booking confirmation** |
| 4 | — | Internal notification **N2** (call booked) |
| 5 | Until 24 h before the call | Send **E6 Reminder** |
| 5b | If booked less than 24 h before | Skip step 5; send **E7 Short reminder** 1 h before (`ASSUMPTION`) |

Cancellation (calendar status = cancelled): remove `call-booked`, move back to **Qualified**, notify team. Do **not** restart WF2 (re-entry off).

## Planned email per tier

| Tier | Emails |
|---|---|
| High, never books | E0 (day 0), E1 (day 1), E2 (day 3) |
| High, books on day 2 | E0, E1, then E5 at booking, E6 24 h before; E2 and E3 suppressed |
| Potential | E0 (day 0), U1 (day 2), U2 (day 5), U3 (day 9) |
| Low | E0 (day 0), U1 (day 2), U2 (day 5), U3 (day 9) |

## Known gaps

- `plan_pdf_link`: PDF generation from app data and hosting not built (G-PDF). E0 uses `{{contact.plan_pdf_link}}`. Until built, a test can link to a hosted sample PDF.
- Booking link in E1–E2: `{{booking_link}}` = mock calendar URL, GAP until built.
- Team notification address and test sender: GAP (D5).
- Activation: needs Nazim's approval of exact copy, sender and test contacts.
