{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/email-sequencer",
  "slug": "adapters/domain/email-sequencer",
  "kind": "capabilities",
  "bucket": "package",
  "title": "email-sequencer",
  "name": "Email Sequencer",
  "eyebrow": null,
  "chip": null,
  "summary": "Email drip-sequence and cadence designer for sales & lifecycle marketing: buildSequence turns a goal (cold-outreach, onboarding, re-engagement, trial-nurture, webinar, abandoned-cart, renewal...",
  "keywords": [
    "email-sequencer",
    "buildsequence",
    "re-engagement",
    "trial-nurture",
    "abandoned-cart",
    "leumas email sequencer",
    "addbranch",
    "replied"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# email-sequencer\n\nAn intelligent microservice adapter pack that designs email drip sequences and send cadences for\nsales engagement and lifecycle marketing. Every tool has a deterministic, offline heuristic/template\ncore; the generative tools (`buildSequence`, `previewStep`) additionally use an optional LLM path to\nrewrite subjects/copy and silently fall back to the templates when no model is reachable. Hybrid\nresults are tagged `{ mode: 'heuristic' | 'llm' }`.\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| `buildSequence` | Turns a `goal` (cold-outreach, onboarding, re-engagement, trial-nurture, webinar, abandoned-cart, renewal, upsell, event-followup, or free text) into a multi-touch drip with day offsets, channels, subject lines and body outlines. **Hybrid.** |\n| `addBranch` | Forks an existing `sequence` on a `condition` (opened / not-opened / clicked / replied / no-response / bounced / unsubscribed) into a recommended branch path, with an exit policy. |\n| `cadence` | Spaces N `touches` over a `windowDays` window using a `curve` (linear, front-loaded, back-loaded, fibonacci) and returns day offsets + gaps. |\n| `previewStep` | Renders one step's subject, preview text, CTA and estimated read time. **Hybrid.** |\n| `followupTiming` | Recommends the next-send delay, priority and best send window from prior `engagement` signals. |\n\n## Usage\n\n```js\nimport pack from './index.js';\n\n// Build a 5-touch cold-outreach drip\nconst seq = await pack.adapters.buildSequence({ goal: 'cold-outreach', steps: 5, audience: 'CTO', product: 'Leumas' });\n// -> { mode, goal, tone, stepCount, totalDays, sequence: [{ step, dayOffset, channel, subject, bodyOutline, cta }, ...] }\n\n// Fork it when a lead clicks\npack.adapters.addBranch({ sequence: seq.sequence, condition: 'clicked', afterStep: 2, product: 'Leumas' });\n\n// Recommend when to follow up next\npack.adapters.followupTiming({ engagement: { opened: true, clicked: true, lastOpenHour: 8 } });\n```\n\n## LLM / hybrid mode\n\nOffline (default) everything runs on deterministic templates. When an OpenAI-compatible endpoint or a\nlocal Ollama server is configured (see `../_shared/llm.js`), `buildSequence` and `previewStep` ask the\nmodel to rewrite only the copy (subjects + body lines) while keeping the heuristic's day offsets,\nchannels and structure. Any model failure falls back to the template core — a down model never throws.\n\n## DRY boundary notes\n\n- Not a scheduler: day offsets are plain integers. `cron` owns interval-string parsing (`'5m'`);\n  `datetime`/`ical` own calendar math and event files. This pack plans *what to send and when*, not\n  wall-clock scheduling.\n- Not a text toolkit: `nlp` / `a-text` own raw string transforms. Copy here is domain-specific\n  marketing templating, not general text processing.\n- Self-contained: no cross-pack imports except `../_shared/llm.js`.\n",
  "source": {
    "path": "shared/engines/adapters/domain/email-sequencer/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 3082,
    "hash": "96445309a0736e3852131f2819c065650c8818bb"
  },
  "urls": {
    "html": "/p/adapters/domain/email-sequencer",
    "json": "/docs/adapters/domain/email-sequencer.json",
    "md": "/docs/adapters/domain/email-sequencer.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
