Skip to main content

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_sendersget_email_instructionscreate_sequencepublish_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

ToolPurposeKey inputsReturns
list_sequencesList all sequences for a funnelfunnelIdArray of sequence summaries
get_sequenceGet a single sequence with its ordered stepsfunnelId, sequenceIdSequence object with steps array
get_email_step_htmlRead the raw HTML body of an ai-email stepfunnelId, sequenceId, stepId{ html }
get_email_instructionsLoad the authoritative email-authoring spec (mandatory before writing HTML)(none)Email authoring rules text
create_sequenceCreate a new email sequence with stepsfunnelId, name, stepsCreated sequence object
update_sequenceReplace the entire step list of an existing sequencefunnelId, sequenceId, stepsUpdated sequence object
publish_sequencePublish a sequence so it starts runningfunnelId, sequenceIdPublished state or confirmation payload
unpublish_sequencePause a published sequencefunnelId, sequenceIdPublished 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

NameTypeRequiredDescription
funnelIdstringYesFunnel (campaign) ID — 24-character hex string
namestringYesHuman-readable name for the sequence
stepsarrayYesOrdered step definitions (see step shapes below)

Step shapes:

  • status{ type: "status", status: "<CRM contact status value>" }. Required first step; exactly one per sequence. status is 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. Use get_crm_properties to discover valid fieldName values.
  • 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? }. delivery may be null at create time; must be set before publish_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

NameTypeRequiredDescription
funnelIdstringYesFunnel (campaign) ID — 24-character hex string
sequenceIdstringYesID of the sequence to update (from list_sequences or create_sequence)
namestringNoNew human-readable name for the sequence (minimum 1 character)
stepsarrayYesComplete 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

NameTypeRequiredDescription
funnelIdstringYesFunnel ID
sequenceIdstringYesSequence ID
acknowledgeCancellationsbooleanNoPass 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.