DocumentationSequence steps

Sequence steps

SEND_EMAIL and WAIT steps, delays, activation rules and DRAFT-only editing.

A sequence is built from ordered steps. There are only two step types, and you can only edit them while the sequence is in DRAFT.

Step types

stepTypeWhat it doesFields it uses
SEND_EMAILSends an emailtemplateVersionId (a PUBLISHED version), optional subject
WAITWaits before the next stepdelayMinutes (>= 1)

Steps are ordered by position (integer >= 0).

Add a step

POST /sequences/{id}/steps
Authorization: Bearer <apiKey or accessToken>
X-Tenant-Id: {tenantId}
Content-Type: application/json

{
  "stepType": "SEND_EMAIL",
  "position": 0,
  "templateVersionId": "ver_123"
}
FieldRequiredNotes
stepTypeYesSEND_EMAIL or WAIT
positionNoStep order (integer >= 0)
delayMinutesWAIT onlyMinutes to wait (>= 1)
templateVersionIdSEND_EMAIL onlyA template version in PUBLISHED state
subjectNoOverrides the subject (up to 998 characters)

A WAIT step of 1440 minutes waits a day before the next send:

{
  "stepType": "WAIT",
  "position": 1,
  "delayMinutes": 1440
}

Step endpoints

MethodPathScopeDescription
POST/sequences/:id/stepssequences:writeAdd step (DRAFT only)
PATCH/sequences/:id/steps/:stepIdsequences:writeEdit step (DRAFT only)
DELETE/sequences/:id/steps/:stepIdsequences:writeDelete step (DRAFT only)

Activation rules

Calling POST /sequences/:id/activate validates the step chain. It must have:

  • At least one step.
  • At least one SEND_EMAIL step (a wait-only sequence sends nothing).
  • Never two consecutive WAIT steps — merge the waits into a single step.

If the chain is invalid, activation fails and the sequence stays in DRAFT.

How delays run

The engine collapses the waits: when a send finishes it looks for the next SEND_EMAIL, sums the delayMinutes of the intervening WAIT steps and schedules a delayed BullMQ job (delayMs = delayMinutes * 60000). Each job is idempotent, with retries and exponential backoff, so a retry never duplicates a send. The email goes out through the normal pipeline — with suppressions and quota enforced, and per-contact locale routing.