uSend Docs
Automations

Steps and conditions

Every step type an automation can use, and how steps connect.

An automation is a list of steps and the connections between them. Each step has a unique key, a type and a config. A connection says which step follows: { "from": "a", "to": "b", "type": "default" }.

There is exactly one trigger step, and every other step must be reachable from it. Steps cannot loop back.

TypeConfigConnections out
triggerevent_namedefault
delayduration, such as "30 minutes", "2 days" (up to 365 days)default
conditionmatch (all or any), rulescondition_met, condition_not_met
wait_for_eventevent_name, timeout (default 7 days)event_received, timeout
send_emailtemplate_id, or from + subject + html/text; reply_to, topic_id, variablesdefault
add_to_segmentsegment_iddefault
contact_updatefirst_name, last_name, unsubscribed, propertiesdefault
contact_deletenonedefault

A branching step can leave one branch without a connection: the run simply ends on that branch.

Delay

Pauses the run. duration is a number and a unit: seconds, minutes, hours, days or weeks.

Condition

Chooses a branch from rules over the contact, the triggering event or the last email:

JSON
{ "match": "all", "rules": [
  { "field": "contact.properties.plan", "operator": "eq", "value": "pro" },
  { "field": "event.total", "operator": "gte", "value": 100 },
  { "field": "email.opened", "operator": "eq", "value": true }
] }

Fields: contact.email, contact.first_name, contact.last_name, contact.unsubscribed, contact.properties.<key>, event.<key>, and email.sent, email.delivered, email.opened, email.clicked, email.bounced, email.complained (about the latest email this run sent, or the step named in email_step).

Operators: eq, neq, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, exists, not_exists. Text comparisons ignore case.

Put a delay before a condition on email.opened, or the email has had no time to be opened.

Wait for event

Pauses until the contact's event arrives, then follows event_received. If it does not arrive within timeout, the run follows timeout. Only events received after the step began count.

Send email

Sends one email to the contact. Use a published template with template_id (an ID or alias), or write the email inline. {{{FIRST_NAME|friend}}}, {{{LAST_NAME}}}, {{{EMAIL}}}, contact properties, event payload keys and {{{UNSUBSCRIBE_URL}}} are filled in. With topic_id, the email only goes to contacts subscribed to that topic and its unsubscribe link leaves just that topic.

The sender must be on a verified domain. Unsubscribed, suppressed and opted-out contacts are skipped.

Add to segment, update contact, delete contact

These change the contact the run is about. contact_update applies to every segment the contact is in, and a property set to null is removed. contact_delete removes the contact from the whole organization.