Build an automation
Turn events into a multi-step email sequence.
Automations send lifecycle email in response to events. You emit an event; an automation whose trigger and filter match enrolls the contact and walks it through steps (delays, sends) on a schedule.
Create the automation
Create an automation with a trigger (an event name like trial.started) and
an optional filter over contact attributes and event properties. It starts
paused — nothing enrolls yet.
Add steps
Add steps (optionally with a timezone-aware send window). A step is one of these types:
- send — deliver a template (optionally an A/B split of versions).
- delay — a standalone wait before the next step. Stack them, place one at the end, and reorder them like any other step.
- wait for event — park the run until a named event arrives, or a timeout elapses, then continue.
- branch — evaluate a filter over the contact and either continue or exit the sequence.
- set attribute — write attributes onto the contact mid-flow (which can move them into a segment).
- webhook — POST the contact + event payload to a public HTTPS endpoint.
Each step has a stable id, so appending steps to a live sequence never disturbs contacts already in flight.
Enable it
Enabling is a separate, deliberate action that validates the sequence's published templates. Only then do matching events enroll contacts.
Emit the triggering event
curl https://sendandretain.com/api/v1/events \
-H "Authorization: Bearer $AEM_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "trial.started",
"properties": { "plan": "Pro" },
"dedupe_key": "trial-jane-1"
}'The response lists the automations the contact was enrolled into.
A/B variants
A step can carry weighted template variants. Assignment is deterministic per contact-run, so a contact always sees the same variant across a sequence. See Automations.
Editing a step that has in-flight runs requires pausing the automation first. Appending new steps does not.
One command for a whole business
Over MCP, email_bootstrap_company installs a business archetype's starter
templates and lifecycle sequences in a single call — welcome, cart recovery,
trial conversion, win-back — all created paused. It's the fastest way to go
from an empty project to an enable-ready setup. See
Automations and the MCP reference.