email_create_automation
Create an event-triggered automation (welcome flow, weekly engagement sequence, win-back).
write email_create_automation
Create an event-triggered automation (welcome flow, weekly engagement sequence, win-back). ALWAYS created paused — test with email_emit_contact_event, then enable via email_set_automation_status on the human's explicit OK. Attribute-routing: create N automations on the same trigger with different filters + priorities; exclusive=true means first-match-only. triggerFilter accepts a flat array (all AND) OR a nested {op:'and'|'or', conditions:[...]} group for OR logic. SEGMENT-ENTRY trigger: set triggerEvent to "$segment_entered" and triggerFilter to [{path:'event.properties.segmentId', op:'eq', value:'<segmentId>'}] to enroll a contact the moment their attributes make them newly match that segment (still throttled/suppressed — no blast). STEP TYPES: 'send' (default — templateSlug), 'delay' (a standalone wait — {delaySeconds} is the pause before the next step; stack them, put one at the end, reorder like any step), 'wait_for_event' (pause until a contact_event arrives or timeoutSeconds elapses), 'branch' (see below), 'set_attribute' (merge {attributes} and/or {addTags}/{removeTags} — tags ARE segment membership), 'webhook' (POST the payload to a public {url}), or 'exit' (end the run here, optionally labeled). Prefer a 'delay' step for waits; a delaySeconds on any other step type is auto-split into a delay step before it. BRANCHES own lanes of child steps that CONVERGE after the branch: yes/no = {filter, yes:[steps...], no:[steps...]} (an empty lane skips straight past); multi = {branches:[{key, label?, filter, steps:[...]}], elseSteps:[...]} — first matching arm wins, everyone else takes the else lane. End a lane early with an 'exit' step; otherwise its contacts continue after the branch. Lanes nest at most two levels. The legacy gate shape {filter, ifMatch, ifNoMatch} ('continue'/'exit') still works.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
triggerEvent | string | No | |
triggerFilter | object[] | any | No | |
priority | integer | No | |
exclusive | boolean | No | |
exitEvent | string | No | |
allowReenrollment | boolean | No | |
reenrollmentCooldownSeconds | integer | No | |
steps | any[] | No | |
triggerSegmentId | string | No | Enroll a contact the moment their attributes newly match this segment. Sugar for triggerEvent "$segment_entered" + a segmentId filter. Provide this OR triggerEvent, not both. |
projectId | string | No | Target company (project id). Org-scoped tokens only; call email_list_projects first. |