Sequences
Email sequences automate follow-up messages that fire when a contact's CRM status changes. These tools let an AI assistant read existing sequences, build new ones from scratch, edit their step definitions, and control their published state. A typical build flow is: list_senders → get_email_instructions → create_sequence → publish_sequence.
Every sequence follows the step structure status → [filter]? → (delay → ai-email)+. The status step is the CRM trigger — not metadata — and must come first. Before writing any email HTML you must call get_email_instructions; the spec it returns encodes SES deliverability rules and email client rendering constraints.
Tools
| Tool | Purpose | Key inputs | Returns |
|---|---|---|---|
list_sequences | List all sequences for a funnel | funnelId | Array of sequence summaries |
get_sequence | Get a single sequence with its ordered steps | funnelId, sequenceId | Sequence object with steps array |
get_email_step_html | Read the raw HTML body of an ai-email step | funnelId, sequenceId, stepId | { html } |
get_email_instructions | Load the authoritative email-authoring spec (mandatory before writing HTML) | (none) | Email authoring rules text |
create_sequence | Create a new email sequence with steps | funnelId, name, steps | Created sequence object |
update_sequence | Replace the entire step list of an existing sequence | funnelId, sequenceId, steps | Updated sequence object |
publish_sequence | Publish a sequence so it starts running | funnelId, sequenceId | Published state or confirmation payload |
unpublish_sequence | Pause a published sequence | funnelId, sequenceId | Published state |
create_sequence
Creates a new sequence with all its steps in one call. The steps array is processed atomically: a structural validation runs first (enforcing status → [filter]? → (delay → ai-email)+), the skeleton is saved, then HTML bodies for all ai-email steps are uploaded to S3.
html is required on every ai-email step when creating. Before writing any HTML, call get_email_instructions — it is a mandatory prerequisite.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
funnelId | string | Yes | Funnel (campaign) ID — 24-character hex string |
name | string | Yes | Human-readable name for the sequence |
steps | array | Yes | Ordered step definitions (see step shapes below) |
Step shapes:
- status —
{ type: "status", status: "<CRM contact status value>" }. Required first step; exactly one per sequence.statusis a CRM contact status value (e.g."New"), not a sequence-level state. - filter —
{ type: "filter", filter: <condition group tree> }. Optional; must be at index 1 if present. Two-level nested group tree: outer group → inner groups → leaf conditions. Useget_crm_propertiesto discover validfieldNamevalues. - delay —
{ type: "delay", delay: { days?, hours?, minutes?, seconds? } }. Sum of units (e.g.{ days: 2 }). NOT{ amount, unit }. - ai-email —
{ type: "ai-email", name, subject, senderId, delivery, html? }.deliverymay benullat create time; must be set beforepublish_sequence.
Returns the created sequence object (same shape as get_sequence).
update_sequence
Replaces the entire step list of an existing sequence (and optionally renames it). The replacement is atomic — the new steps array must be a complete, valid sequence definition, not a partial patch. The same structural rule applies: status → [filter]? → (delay → ai-email)+.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
funnelId | string | Yes | Funnel (campaign) ID — 24-character hex string |
sequenceId | string | Yes | ID of the sequence to update (from list_sequences or create_sequence) |
name | string | No | New human-readable name for the sequence (minimum 1 character) |
steps | array | Yes | Complete replacement step definitions — same shapes as create_sequence steps |
For the full step shapes (status, filter, delay, ai-email), see the create_sequence step shapes section above.
Returns the updated sequence object (same shape as get_sequence).
publish_sequence
Publishes a sequence draft so it begins running for matching contacts. If a previous version is live with active in-flight runs, the tool first returns a confirmation payload (confirmationRequired: true) with the count of runs that would be cancelled. Re-call with acknowledgeCancellations: true to proceed.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
funnelId | string | Yes | Funnel ID |
sequenceId | string | Yes | Sequence ID |
acknowledgeCancellations | boolean | No | Pass true to confirm cancellation of in-flight runs from the previous version |
Returns either { data: { id, published: true } } or a confirmation payload when active runs exist.
Related
- Guide: ../../guides/email-sequences