# Automation triggers and steps

> Every trigger (what starts an automation) and every step (email, wait, if/then, tag, coupon, push, webhook), with the settings, rules and limits.

Source: https://docs.personacart.com/growth/automation-triggers-and-actions

In short: {"Every trigger (what starts an automation) and every step (email, wait, if/then, tag, coupon, push, webhook), with the settings, rules and limits."}

An automation is a **trigger** (what starts it) followed by **steps** (what it does). This page lists every trigger and every kind of step, with the settings each one has. For the screens themselves, see [Automations](/growth/automations).

## Where to find it

Sidebar → GROWTH → Automations.

1. Press **New automation**, then **Or build manually**. Or press **Edit** on a row of your list.
2. The builder opens with one card at the top, **When**. Click it to open its settings in a side panel.
3. In the panel, open **Trigger Event** (it says "Select trigger…") and pick the trigger.
4. Close the panel, then press the round **+** under the last card (**Add a step after this**) to add a step. Pick one of the eight kinds.
5. Click any card to change its settings. Name the automation in the **Workflow name…** box at the top.
6. Press **Save**. This stores the automation but does not turn it on: press **Activate** when you are ready.

## Understand how an automation runs

1. Something happens in your store (the trigger). The automation starts a **run** for that customer or event.
2. The run goes through the steps in order. A **Wait** pauses it; an **If / then** sends it down the **Yes** or **No** branch.
3. The run ends when it reaches the last step (**Completed**), when a step fails (**Failed**), or when you pause the automation (**Cancelled**).

The flow is a line with branches. Each step has at most one step after it, except an If / then, which has exactly two: Yes and No.

## Choose a trigger

- You choose one trigger per automation, in the first step.
- There are 42.
- The last column lists the fields that trigger carries: these are the fields you can test in an **If / then** step or in the trigger's **Entry filters**. `customer_tags` is a special field that looks up the customer's tags when the event is about a person.

### Customers

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **New customer** | Customer signs up or is created | customer_id, email, name, source, customer_tags |
| **Tag added** | A tag is applied to a customer | customer_id, tags, customer_tags |
| **Customer Updated** | A customer record is updated | customer_id, field, customer_tags |

### Orders

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Order placed** | New order is placed | order_id, customer_id, customer_email, total, currency, item_count, display_number, customer_tags |
| **Order fulfilled** | Order is shipped or fulfilled | order_id, customer_email, total, customer_tags |
| **Order Updated** | An order is updated (tracking, notes, etc.) | order_id, field |
| **Order Completed** | An order reaches final delivered state | order_id, customer_id, customer_tags |

### Commerce and subscriptions

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Cart abandoned** | Checkout session abandoned (cart inactive for the abandoned-cart delay set for your store, 60 minutes by default) | cart_id, customer_email, customer_name, cart_total, customer_tags |
| **Product Purchased** | A specific product is bought | order_id, customer_id, product_id, product_name, quantity, unit_price, total, customer_tags |
| **Subscription Created** | New subscription is created | subscription_id, customer_id, product_id, plan, order_id, customer_tags |
| **Subscription cancelled** | A subscription is cancelled (by the buyer, the creator or the payment provider) | subscription_id, customer_id, product_id, reason, phase, immediate, new_period_end, customer_tags |
| **Checkout Completed** | A checkout session is completed with order creation | checkout_id, order_id, customer_email, total, customer_tags |

### Payments

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Payment Succeeded** | A payment is successfully processed | transaction_id, checkout_id, amount_cents, gateway |
| **Payment failed** | A payment attempt fails | transaction_id, checkout_id, gateway |
| **Payment refunded** | A payment is refunded | transaction_id, checkout_id, gateway |
| **Subscription payment failed** | A subscription payment attempt fails | subscription_id, amount_cents, currency, gateway |

### Bookings

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Booking created** | New booking is made | booking_id, customer_email, customer_tags |
| **Booking cancelled** | A booking is cancelled | booking_id, customer_email, customer_tags |
| **Booking confirmed** | A booking is confirmed | booking_id, customer_email, customer_tags |

### Leads and forms

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Form Submitted** | A storefront contact form is submitted | email, name, customer_tags |
| **New Lead** | A new lead is captured (form, lead magnet, or API) | lead_id, email, source, score, customer_tags |
| **Lead Magnet Downloaded** | A visitor downloads a lead magnet | email, lead_magnet_id, customer_tags |
| **Newsletter Signup** | A visitor subscribes to the newsletter | email, customer_tags |

### Courses and certificates

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Course Enrollment** | A student is enrolled in a course (paid, complimentary, or direct) | enrollment_id, customer_id, curriculum_id, product_id, customer_tags |
| **Lesson Completed** | A student completes a lesson | enrollment_id, customer_id, curriculum_id, lesson_id, customer_tags |
| **Course completed** | A student completes an entire course | enrollment_id, customer_id, curriculum_id, customer_tags |
| **Quiz Passed** | A student passes a quiz | quiz_id, customer_id, enrollment_id, score, attempt_number, customer_tags |
| **Quiz Failed** | A student fails a quiz | quiz_id, customer_id, enrollment_id, score, attempt_number, customer_tags |
| **Certificate issued** | A certificate is issued to a student | certificate_id, definition_id, customer_id, enrollment_id, customer_tags |
| **Certificate Entering Grace Period** | An issued certificate enters its renewal grace period | certificate_id, definition_id, customer_id, customer_tags |
| **Certificate Expired** | An issued certificate has fully expired | certificate_id, definition_id, customer_id, customer_tags |

### Campaigns

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Campaign Sent** | A campaign finishes sending to all recipients | campaign_id, campaign_name, campaign_type, total_sends |
| **Campaign Completed** | 24 hours after a campaign finishes, with its opens and clicks | campaign_id, campaign_name, campaign_type, total_sends, open_count, click_count |

### Products and stock

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Product Low Stock** | A product's inventory drops below its low-stock threshold | product_id, variant_id, current_stock, reorder_point |
| **Product Price Dropped** | A product's price is reduced (sale or manual update) | product_id, old_price, new_price |

### Loyalty

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Loyalty Milestone** | A customer reaches a loyalty points or tier milestone | customer_id, milestone, points_earned, total_points, customer_tags |

### AI-powered (customer intelligence)

| Trigger | Fires when | Fields you can check |
|---|---|---|
| **Likely to Churn** | Customer at risk of churning (probability > 0.6) | customer_id, churn_probability, risk_level, customer_tags |
| **Customer at Risk** | Your store's health score falls below 40. This is about the store, not one customer, so it carries no customer to email or tag | health_score, bucket |
| **Re-engagement Due** | Customer overdue for repeat purchase | customer_id, decay_ratio, days_since_last_order, customer_tags |
| **Segment Entered** | Customer enters an intelligence segment (Champions, At Risk, etc.) | customer_id, segment_id, segment_name, customer_tags |
| **Score Changed** | Customer health/CLV/intent score changes beyond threshold | customer_id, score_type, old_value, new_value, customer_tags (changes to your store's health score carry no customer) |
| **Experiment Converted** | A/B test variant conversion recorded | campaign_id, send_id, recipient, url |

### Extra settings on a few triggers

These triggers show extra fields in the side panel, but the automation does not use them today:

- **Score Changed**: **Score Threshold** and **Direction** (**Drops Below** or **Rises Above**). The automation starts on every score change.
- **Segment Entered**: **Target Segment**. The automation starts when a customer enters any segment.
- **Experiment Converted**: **Experiment**. The automation starts on every conversion.

To narrow one of these, use **Entry filters** (below).

### Entry filters

- Every trigger has **Entry filters**: "Only enter when the event matches these conditions. No filters = enter on every event." Add filters with **Add filter**: pick a **field** from the trigger's list, an operator, and a **value**.
- **Match** chooses **All (AND)** or **Any (OR)**.
- Operators: **equals**, **not equals**, **greater than**, **≥**, **less than**, **≤**, **contains**, **exists**, **missing**.
- **Remove filter** deletes one.

### Re-entry rules

Open the **When** card to find **Re-entry rules**. They limit how often the same customer can start this automation, which prevents email fatigue and runaway loops:

- **Suppress for (hours)**: after a customer enters, they cannot enter again for this many hours.
- **Max entries / customer**: the most times one customer can enter. The count is kept for 90 days, or for the suppress time if that is longer.

With both set to `0` the automation starts once for each event (the same cart, order or booking), or once per customer when the trigger is about a customer. Setting any value replaces that default. A safety cap also stops an automation that triggers itself over and over. The cart-recovery automation your store gets by default uses a 168-hour (7-day) suppress time and one entry per customer, so a shopper enters it about once every 90 days.

## Add steps

The **+** button (**Add a step**) offers eight kinds of step: **Email**, **Wait**, **If / then**, **Tag**, **Coupon**, **Push**, **Campaign** and **Webhook**.

### Email

Sends an email to the customer.

- **Template**: "Store default design", or a saved email design. Your subject and body are placed inside it.
- **Subject** (required). Unknown details in a subject block sending.
- The body is written in the same blocks editor as a campaign:
  - Blocks: **Heading**, **Text**, **Button**, **Cart items** (the things the shopper left in their cart, filled in per person), **Coupon**, **Product** and **Line**.
  - On a **Button**, choose the button words and where it goes (for example "Back to their cart", "Your store", "The product page", "Use the coupon", or another web address starting with https://).
  - **Add a detail** puts in things like the customer's first name.
  - **Look** gives this one email its own look; **Send test to me** sends it to your own address.
- A **Coupon** block shows the code made by an earlier **Coupon** step. If an email uses a coupon but no Coupon step runs before it, the panel warns: 'This email uses a coupon tag, but no discount step runs before it.' Otherwise the tag would go out blank.
- An email is not sent to someone who unsubscribed or whose address does not work; that run shows the reason.

### Wait

Pauses the run before the next step.

- Under **How long to wait**, tap a quick choice such as **1 hour** or **1 day**, or tap **Custom** to enter a **Duration** and a **Unit** (**Minutes**, **Hours**, **Days**). The longest wait is **180 days**.
- **Quiet hours (Do Not Disturb)**: **Don't send during quiet hours** with a **From** and **To** time (24-hour, for example 21:00).
  - If a wait ends inside quiet hours, the next step is held until they end.
  - Times use the buyer's time zone when known, otherwise your store's.
  - Example: a 6-hour wait started at 6 pm with quiet hours 8 pm to 8 am fires at noon the next day.
- **Only send between … and … (customer's time)**: a send window. Hours outside it do not count toward the wait.

### If / then (condition)

Splits the run into **Yes** and **No**.

- **Label** (for example "Has purchased before?").
- **Field**: chosen from the fields the trigger carries, plus **Customer tags**. If the trigger carries nothing to check, the panel says to remove the step or pick a different trigger; if there is no trigger yet, it says to choose one first.
- **Operator**: **Equals**, **Not Equals**, **Greater Than**, **Less Than**, **Contains**.
- **Value**.
- For **Customer tags** the operators are **has any of**, **has all of** and **has none of**, with a **Tags** box (type a tag and press Enter). Pick at least one tag.

If a run reaches a condition with no matching branch connected, it ends as completed.

### Tag

**Action**: **Add tag** or **Remove tag**, and the **Tag Name** (for example vip). Tags are what you use to group customers in [Customers](/commerce/customers) and [Segments](/commerce/segments).

### Coupon (discount)

Creates a discount code.

- **Label** (for example "10% off welcome").
- **Discount Type**: **Percentage** or **Fixed amount**; **Value** (above 0; a percentage cannot be over 100).
- Each run makes **a one-of-a-kind code** (it starts with AUTO), so every customer gets their own. If the same email still holds an unused code from this step, no new code is made and the old code's expiry moves out instead. By default the code **expires after 7 days**.
- **Email the code** (on by default): the step emails the code to the customer. Turn it off if a later **Email** step already shows the code with a **Coupon** block, so the customer gets one mail, not two. The code is still made either way. Coupon steps saved before this switch existed keep emailing.

### Push

Sends a browser push notification: **Title**, **Body** and **Click URL**. Fill in a title or a body: a push with neither does nothing, and the run does not tell you.

### Campaign

**Campaign**: you can pick a campaign you have already created. **Do not use this step today**: a run that reaches it fails, after any earlier steps have already run. If you have no campaigns, the panel says "No campaigns yet. Create one under Growth → Campaigns, then pick it here."

### Webhook

Sends data to another app when the run reaches this step.

- **URL**: must start with http:// or https://.
- **Method**.
- **Headers**: for example **Authorization** with a bearer token, which tools such as GoHighLevel, Zoho or Make need.
- **Custom data**: extra fields added to the JSON body (for example a tag). They override trigger fields with the same name.
- **Signing secret** (optional): when set, the request carries an `X-PersonaCart-Signature` header, an HMAC-SHA256 of the body, which your endpoint can verify to confirm the request came from PersonaCart.
- **Payload preview** shows the exact JSON with example values. It always includes `run_id`, `workflow_id` and `tenant_id`, plus the trigger's fields and your custom data.

### Text message

- The engine also has a text-message step (it appears as "send a text message" in an automation's summary and in test runs).
- It sends through your own Twilio account and only to people who agreed to texts, so set up [Text messages](/settings/text-messages) first.
- If texting is off, the step stops with a clear message.
- It is not in the **Add a step** picker.

## Know the limits

:::warning[Limits that protect your customers]
- Your plan sets how many automations can be active at once. Drafts do not count. Pressing **Activate** over the limit is refused.
- A single run stops after **100 steps**. A flow whose steps loop back on themselves is refused when you save it.
- Every step must be connected to the trigger. You can add and save an unconnected step, but **Activate** is refused until every step is linked.
- Pausing an automation stops runs that are waiting in a delay before their next step.
- Emails respect each person's unsubscribe and your sending limits; a run that is held back shows why in its trace.
:::

## Questions
