Steps
Available steps
Section titled “Available steps”Steps are the building blocks of Automation workflows. They define the actions that will be executed when the Automation runs.
Learn more about each available step in its dedicated guide:
Step properties
Section titled “Step properties”Every step in an automation has common base properties: key, type, and a config object whose shape depends on the type of the step.
key(string, required) — A unique identifier for the step. Used in connection definitions to connect steps.
type(string, required) — The type of step. Possible values:
triggerconditiondelaywait_for_eventsend_emailadd_to_segmentcontact_updatecontact_delete
config
Section titled “config”config(object, required) — The configuration object for the step. The shape depends on the steptype.
See the configuration for each step type:
Step configuration
Section titled “Step configuration”Below is a list of all the possible step types and their configurations.
trigger
Section titled “trigger”The trigger step starts the automation when a matching event is received.
config.event_name(string, required) — The name of the event that triggers the automation.
{
"key": "start",
"type": "trigger",
"config": {
"event_name": "user.created"
}
}condition
Section titled “condition”Branches the workflow based on rules. Condition configs can be a single rule or a logical group (and/or) of rules.
config.type(string, required) — The type of condition node. Possible values:
ruleandor
For rule type:
-
config.field(string, required) — The field to evaluate. Must use theevent.orcontact.namespace prefix (e.g.,event.amount,contact.email). -
config.operator(string, required) — The comparison operator. Possible values:
eq: equalsneq: not equalsgt: greater thangte: greater than or equal tolt: less thanlte: less than or equal tocontains: contains a given valuestarts_with: starts with a given valueends_with: ends with a given valueexists: field existsis_empty: field is empty
config.value(string | number | boolean | null) — The value to compare against. Not required forexistsandis_emptyoperators.
For and / or types:
config.rules(object[], required) — An array of nested condition config objects. Must contain at least one item.
Single rule example:
{
"key": "check_plan",
"type": "condition",
"config": {
"type": "rule",
"field": "event.plan",
"operator": "eq",
"value": "pro"
}
}Use and or or to combine multiple rules into a single branch:
{ "key": "check_plan_and_amount", "type": "condition", "config": { "type": "and", "rules": [ { "type": "rule", "field": "event.plan", "operator": "eq", "value": "pro" }, { "type": "rule", "field": "event.amount", "operator": "gte", "value": 100 } ] }}Pauses execution for a specified duration.
config.duration(string, required) — The delay duration in natural language (e.g."1 hour","3 days"). Maximum: 30 days.
{
"key": "wait_1_hour",
"type": "delay",
"config": {
"duration": "1 hour"
}
}wait_for_event
Section titled “wait_for_event”Pauses execution until a specific event is received or a timeout is reached.
-
config.event_name(string, required) — The name of the event to wait for. -
config.timeout(string) — The maximum time to wait before timing out (e.g."3 days","1 hour"). Maximum: 30 days. -
config.filter_rule(object) — An optional rule object to filter incoming events.
{
"key": "wait_for_purchase",
"type": "wait_for_event",
"config": {
"event_name": "purchase.completed",
"timeout": "3 days"
}
}send_email
Section titled “send_email”Sends an email using a template.
config.template(object, required) — The published template to send. Provideidand optionallyvariables.
properties
config.template.id(string, required) — The ID or alias of the template to send.config.template.variables(object) — A key-value map of template variables. Each value can be a static string or a variable reference object ({ "var": "event.fieldName" }) that resolves dynamically from theevent.*,contact.*, orwait_events.*namespaces.
config.from(string) — The sender email address.
If provided, this value will override the template's default value.
config.subject(string) — The email subject line.
If provided, this value will override the template's default value.
config.reply_to(string) — Reply-to email address.
If provided, this value will override the template's default value.
{
"key": "welcome",
"type": "send_email",
"config": {
"template": {
"id": "062f8ef4-fbfa-44f1-b5e0-ff8e1e8ffa96",
"variables": {
"name": { "var": "event.firstName" }
}
},
"from": "hello@example.com",
"subject": "Welcome!",
"reply_to": "support@example.com"
}
}add_to_segment
Section titled “add_to_segment”Adds the contact to a segment.
config.segment_id(string, required) — The ID of the segment to add the contact to.
{
"key": "add_to_vip",
"type": "add_to_segment",
"config": {
"segment_id": "83a1e324-26dc-47eb-9b28-ba8b6d1fe808"
}
}contact_update
Section titled “contact_update”Updates a contact's fields. Each field value can be either a hardcoded value or a dynamic variable reference using the { var: '...' } syntax.
Variable references use dot-notation with one of these scopes:
event.*: references a field from the triggering event payload (e.g.,event.firstName).contact.*: references a field from the current contact (e.g.,contact.last_name,contact.properties.company).
-
config.first_name(string | object) — The contact's first name. Accepts a hardcoded string or a variable reference. -
config.last_name(string | object) — The contact's last name. Accepts a hardcoded string or a variable reference. -
config.unsubscribed(boolean | object) — The contact's unsubscribed status. Accepts a boolean or a variable reference. -
config.properties(object) — A map of custom contact properties to update. Keys correspond to your Contact Custom Properties. Each value can be a hardcoded value (string, number, boolean) or a variable reference.
{
"key": "update_contact",
"type": "contact_update",
"config": {
"properties": {
"company": { "var": "event.company" },
"vip": true
}
}
}contact_delete
Section titled “contact_delete”Deletes the contact from the audience. This step does not require any configuration fields. Pass an empty object {} as the config.
{
"key": "remove_contact",
"type": "contact_delete",
"config": {}
}