> ## Documentation Index
> Fetch the complete documentation index at: https://chatbase.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# WhatsApp Automations

> Send customers an approved WhatsApp template automatically when something happens in another tool, such as a new Shopify order. Choose who gets which message with rules, conditions and a fallback.

Chatbase WhatsApp Automations send a customer an approved WhatsApp message template automatically when something happens in a tool your AI agent is connected to, such as a new order in your Shopify store. They're for stores that want order messages on WhatsApp without sending them by hand. For example, a store can confirm every new order on WhatsApp, ask cash-on-delivery customers to confirm before shipping, or send a discount code for the next order when an order's total is above a set amount.

Each automation picks the right template for the order with **rules**. Rules are checked from top to bottom, and the first one whose conditions match sends its template. An optional **fallback** template covers orders that no rule matches.

## WhatsApp automation types and triggers

Every automation has a **type** and a **trigger**:

* The **type** is the tool the event comes from.
* The **trigger** is the event inside that tool that starts the automation.

| Type | Trigger | Starts when |
| - | - | - |
| Shopify | Order created | A customer places an order in your Shopify store. |

An AI agent can have **one automation per trigger**. Once it has an *Order created* automation, **Add automation** is disabled, and you change that automation instead of adding another.

## Before you create a WhatsApp automation

* **Have permission to manage integrations.** Owners and Members can create automations. Viewers can see them but not change them. See [Roles and permissions](#roles-and-permissions).
* **Use a workspace without HIPAA compliance.** WhatsApp Automations aren't available on HIPAA-compliant workspaces. See [HIPAA compliance](https://chatbase.co/docs/user-guides/workspace/hipaa-compliance.md).
* **Connect Shopify** to your AI agent. See [Shopify](https://chatbase.co/docs/user-guides/integrations/shopify.md).
* **Connect a WhatsApp number** to the same AI agent. See [WhatsApp](https://chatbase.co/docs/user-guides/integrations/whatsapp.md). The automation sends from this number.
* **Create and get approval for the templates** you want to send, in the WhatsApp Business Account of that number. See [WhatsApp Templates](https://chatbase.co/docs/user-guides/integrations/whatsapp-templates.md). Only approved templates can be picked.
* **Make sure orders have a phone number.** The message goes to the phone number on the order, its customer, or its shipping or billing address, in that order. Orders without a valid phone number are skipped.

## Create a WhatsApp automation

**1. Open the Automation tab**

Go to **Channels → WhatsApp** and open the **Automation** tab. Click **Add automation**.

![The WhatsApp page's Automation tab with the Create your first automation empty state and an Add automation button](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/01-automation-tab.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=86a4df546388337fead43a32e7f69b03)

**2. Check the type and trigger, and choose the phone number**

The editor opens with **Type** set to **Shopify** and **Trigger** set to **Order created**. Under **Phone number**, choose the WhatsApp number the messages are sent from in **Send from**.

![New automation editor showing Type Shopify, Trigger Order created and the Send from phone number](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/02-type-trigger.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=d21c4db038676af0155a0175a1fbc98a)

**3. Add a rule and its conditions**

Under **Match & send**, give the first rule a name that says what it matches, such as *Match cash*. Then add its conditions. For each condition, pick an order field in **Variable**, an operator in **Condition**, and type or pick a **Value**.

![The Variable dropdown open, listing order fields grouped under Payment & money, Customer & address and Products](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/03-condition-variables.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=abd3b01109fa467ced1d46fde30f3d69)

Choose **Match all** when every condition has to be true, or **Match any** when one is enough. Click **Add condition** for more. See [Conditions](#whatsapp-automation-conditions) for every field and operator.

For **Payment method**, type the name of the payment method as Shopify shows it under **Settings → Payments**. The hint below the condition reminds you where to look, and [Payment method condition](#payment-method-condition) shows how to find the exact name.

![A rule named Match cash with one condition: Payment method contains cash, with the hint below it pointing to Settings > Payments in Shopify](https://mintcdn.com/chatbase/DsuisO4MveZi3w1Y/user-guides/integrations/images/whatsapp-automations/04-rule-conditions.png?fit=max\&auto=format\&n=DsuisO4MveZi3w1Y\&q=85\&s=c95b6c67c623dc1efaa8cd1d649c3446)

**4. Pick the template**

Under **Then**, click **Select template** and pick an approved template.

![The Select template dialog listing approved WhatsApp templates](https://mintcdn.com/chatbase/YLb4rX0d3UMxlLqO/user-guides/integrations/images/whatsapp-automations/05-template-picker.png?fit=max\&auto=format\&n=YLb4rX0d3UMxlLqO\&q=85\&s=9e89ba4566ebe850a9cabe57255fc468)

> [!WARNING]
>
> Automations fill variables in the template's **body** only. If a template has variables in its header, the automation can't fill them, so pick a template whose header has no variables.

**5. Fill in the template's variables**

For each variable in the template, such as `{{1}}`, choose the order field that fills it, or **Custom text** to type a fixed value. See [Template variables](#whatsapp-automation-template-variables).

![A template variable's dropdown open, listing order fields and Custom text](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/06-variable-sources.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=db68edf14e21a84bfa8dcff4bd56ef14)

![The Order Confirm template with \{\{1}} set to Customer first name and \{\{2}} set to Order number](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/07-template-variables.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=f83246aefde7b79aa14521e20b1a4b5e)

The WhatsApp preview on the right shows the message with your choices filled in.

![The WhatsApp preview showing Hello \[Customer first name\], We received your order \[Order number\]](https://mintcdn.com/chatbase/YLb4rX0d3UMxlLqO/user-guides/integrations/images/whatsapp-automations/08-phone-preview.png?fit=max\&auto=format\&n=YLb4rX0d3UMxlLqO\&q=85\&s=7d3c52a9cddd3cd7c4b69aa0ed87a921)

**6. Add more rules and a fallback (optional)**

Click **Add rule** for more cases, and drag rules to change their order. The top-most rule that matches wins.

To send something when no rule matches, turn on **Send a fallback message**, then pick its template and fill in its variables.

![The fallback turned on with the Order Confirm template, \{\{1}} set to Custom text there and \{\{2}} set to Order number](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/09-fallback.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=df9a5b12ba431d745afc5f9696976312)

Each template has an eye button next to its **Preview**. Click it to show that template in the WhatsApp preview. Otherwise, the preview shows the top-most rule's template.

![The WhatsApp preview showing Hello there after clicking the fallback's eye button](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/10-fallback-preview.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=1d57551cca34e265826d3563f8209360)

> [!NOTE]
>
> An automation needs at least one rule or the fallback.

**7. Save & enable**

Click **Save & enable**. The automation is saved, turned on, and you're taken back to the list. It sends on the next order that comes in.

![The Automation tab listing the Order created automation as Active](https://mintcdn.com/chatbase/YLb4rX0d3UMxlLqO/user-guides/integrations/images/whatsapp-automations/11-automation-list.png?fit=max\&auto=format\&n=YLb4rX0d3UMxlLqO\&q=85\&s=ea16cf9e7e57d8e8f275111de10ac1aa)

## WhatsApp automation conditions

Conditions compare a field of the new Shopify order with the value you enter.

| Group | Variable | Conditions |
| - | - | - |
| Payment & money | Payment method | is, is not, contains, does not contain |
| | Order total | equals, does not equal, is greater than, is at least, is less than, is at most |
| | Payment status | is, is not |
| | Subtotal | equals, does not equal, is greater than, is at least, is less than, is at most |
| | Total discounts | equals, does not equal, is greater than, is at least, is less than, is at most |
| | Shipping price | equals, does not equal, is greater than, is at least, is less than, is at most |
| | Currency | is, is not |
| | Discount code | is, contains, is set, is not set |
| Customer & address | Shipping country | is, is not |
| | Shipping province/state | is, is not |
| | Shipping city | is, is not, contains |
| | Shipping postal code | is, is not, starts with |
| | Customer tags | contains, does not contain |
| | Customer email | is set, is not set |
| | Customer phone | is, is not, starts with |
| Products | Product title | contains, does not contain |
| | Product SKU | contains, does not contain |
| | Product vendor | contains, does not contain |
| | Number of products | equals, does not equal, is greater than, is at least, is less than, is at most |
| | Total quantity | equals, does not equal, is greater than, is at least, is less than, is at most |
| | Total weight (g) | equals, does not equal, is greater than, is at least, is less than, is at most |

How values are compared:

* **Text** ignores upper and lower case and spaces around the value.
* **Lists** (customer tags, discount codes, product titles, SKUs and vendors) match **contains** when any item contains your text, and **does not contain** when no item does.
* **Numbers** never match when the order has no value for that field.
* **Payment status** is picked from a list: Pending, Authorized, Partially paid, Paid, Partially refunded, Refunded, Voided.
* **Shipping country** is picked from the country list. **Currency** is a currency code such as `USD`.
* **Shipping province/state** matches either the name or the code, such as `California` or `CA`.
* **Customer phone** is the number the message goes to, with a `+` and its country code, such as `+14155550123`. A number saved without a country code gets the code of the shipping or billing country. Use **starts with** and a country code to match customers in one country. The US and Canada share `+1`, so `+1` matches both; add an area code, such as `+1415`, to match one area.

### Payment method condition

**Payment method** matches the **gateway name** Shopify stores on the order, as plain text.

For a manual payment method, the gateway name is the method's name as it appears in Shopify admin under **Settings → Payments → Manual payment methods**, such as `Cash on Delivery (COD)` or `Example Pay`.

![Shopify admin Payments settings, Manual payment methods: Cash on Delivery (COD) and Example Pay, both Active](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/18-shopify-payment-methods.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=4776c88ec963e94cd52adb934bdf27fa)

Other gateways can store a different name from the one your checkout and admin show. Shopify's test gateway, for example, shows as "(for testing) Bogus Gateway" on the order, but its gateway name is `bogus`. To see the gateway of an order, open the order and, in its **Timeline**, expand the payment line.

![A Shopify order timeline with the payment expanded, showing Gateway (for testing) Bogus Gateway](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/19-shopify-order-gateway.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=2364c8a7804cfcc4de7f0f127e811878)

> [!TIP]
>
> Use **contains** with a short, distinctive word from the name, such as `cash` or `bogus`, when you're not sure of the exact name. Use **is** when you know it, such as `Example Pay`.

## WhatsApp automation template variables

The automation fills each variable in a template from the Shopify order, or from text you type. You can pick Customer first name, Customer full name, Customer email, Customer phone, Order number, Order summary, Items, Order total, Subtotal, Shipping fee, Payment method, Item count, Discount code, Shipping address, Shipping city, Shipping country or Custom text. The ones that need explaining:

| Value | What it fills in |
| - | - |
| Customer first name | The customer's first name, or the first name on the shipping or billing address. |
| Customer full name | The customer's full name, or the name on the shipping or billing address. |
| Customer phone | The number the message goes to, with its country code, such as `+14155550123`. |
| Order number | The order's name, such as `#1001`. |
| Order summary | One line with the order number, items, shipping address and total. |
| Items | Every item in the order, separated by commas, such as `Wool Socks (M) x2, Beanie x1`. |
| Order total | The total with its currency, such as `USD 254.79`. |
| Subtotal | The order's subtotal with its currency, such as `USD 100.00`: the items' prices after discounts, before shipping and taxes. It's the same amount the **Subtotal** condition compares. |
| Shipping fee | The order's shipping cost with its currency, such as `USD 15.00`. An order with free shipping shows `USD 0.00`. |
| Payment method | The order's gateway names. See [Payment method condition](#payment-method-condition). |
| Item count | The total quantity of items. |
| Custom text | The text you type, the same for every order. Up to 255 characters. |

WhatsApp doesn't allow line breaks inside a variable, so each value is a single line. To put the items on their own line, use **Items** and add the line breaks in the template's text around it.

If a rule matches but the order has no value for one of its variables, such as a guest checkout without a first name, that rule is skipped and the next rule is checked. The fallback is skipped the same way. To always send something, use **Custom text** or a field every order has.

## What a WhatsApp automation does when a Shopify order comes in

1. Each AI agent connected to the store checks its active *Order created* automation.
2. Rules are checked from top to bottom. The first rule that matches and can fill all its variables sends its template.
3. If no rule sends, the fallback sends, if it's on and can fill its variables.
4. The message goes to the phone number on the order. Each order gets at most one message per AI agent, even if Shopify sends the same order twice.

## Manage your WhatsApp automations

The **Automation** tab lists each automation with its type, its trigger, when it was last updated and whether it's **Active**. Use **Category** to show only one type.

![The Category filter open with All and Shopify](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/14-category-filter.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=3a6ce1a47fd05657fa43e5ebe8594b7d)

When every trigger already has an automation, **Add automation** is disabled. Hover over it to see why.

![A tooltip on the disabled Add automation button: Each trigger can have one automation. Edit the existing one instead.](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/15-one-per-trigger.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=8498671b5f67bb62ac2f055a0d9b9085)

### Edit or pause an automation

Click an automation to edit it. Its saved rules start collapsed and show their names. Click a rule to expand it.

![Match & send with two collapsed rules: Match cash and Match Example Pay](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/12-rules-collapsed.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=ebb5f5f3458198e1540166d7ccb0f625)

Use the **Active** switch next to **Save changes** to turn the automation off or back on, then click **Save changes**. You stay on the page after saving. **Save changes** stays disabled until you change something.

![Edit automation header with the Active switch turned on next to the Save changes button](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/13-edit-header.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=f6d21c48d0c03d9aefeb8df11e318a77)

### Delete an automation

Open the **⋯** menu on an automation and choose **Delete**, then confirm. Deleting can't be undone. Deleting needs permission to delete integrations, which Owners and Members have.

![The automation's menu open with Delete](https://mintcdn.com/chatbase/vqI1HlwQDAQejNk0/user-guides/integrations/images/whatsapp-automations/16-delete-menu.png?fit=max\&auto=format\&n=vqI1HlwQDAQejNk0\&q=85\&s=5bb981705ddf4fe8fefea2bd8011ef61)

> [!WARNING]
>
> Disconnecting Shopify from your AI agent deletes its Shopify automations.

### Roles and permissions

What a workspace member can do with automations depends on their role's **Integrations** permissions:

| Role | See automations | Create, edit, turn on or off | Delete |
| - | - | - | - |
| Owner | Yes | Yes | Yes |
| Member | Yes | Yes | Yes |
| Viewer | Yes | No | No |
| Custom role | With view access to integrations | With edit access to integrations | With delete access to integrations |

A Viewer can open the **Automation** tab and every automation, but **Add automation**, **Connect Shopify**, **Delete**, the **Active** switch, **Save & enable** and **Save changes** are disabled. Hovering over them shows "You do not have the permission to complete this action." Ask an Owner for a role with access to integrations. See [Workspace roles](https://chatbase.co/docs/user-guides/workspace/settings.md#modify-workspace-member-role).

### Audit log

Creating, editing, turning on or off, and deleting an automation each add an entry to the workspace's [audit logs](https://chatbase.co/docs/user-guides/workspace/settings.md#audit-logs). The entry's object type is **Channel**, its name is **WhatsApp automation**, and it records who made the change and when. Edit entries also record whether the automation is active.

### HIPAA-compliant workspaces

WhatsApp Automations aren't available on HIPAA-compliant workspaces. The **Automation** tab shows "Not available on HIPAA-compliant accounts." instead of the list, and no automation sends on a HIPAA-compliant workspace. WhatsApp is blocked on these workspaces, and HIPAA compliance can't be turned on while a WhatsApp number is connected. See [HIPAA compliance](https://chatbase.co/docs/user-guides/workspace/hipaa-compliance.md).

### Limits

* One automation per trigger for each AI agent.
* Up to 25 rules per automation and 10 conditions per rule.
* Up to 50 variables in a template body.
* Rule names, condition values and custom text can be up to 255 characters.

## Example: confirm cash on delivery and Example Pay orders on WhatsApp

A store offers two manual payment methods, **Cash on Delivery (COD)** and **Example Pay**. It wants every order paid with either one confirmed on WhatsApp, greeting the customer by first name when the order has one.

It uses one approved template, *order\_confirm*:

```text wrap theme={null}
Hello {{1}},

We received your order {{2}}. We'll send you a status update once your payment is approved.

Thank you for shopping with us!
```

The automation has two rules and a fallback, all with this template and `{{2}}` = Order number:

| Name | Conditions | `{{1}}` |
| - | - | - |
| Match cash | Payment method contains `cash` | Customer first name |
| Match Example Pay | Payment method is `Example Pay` | Customer first name |
| Fallback | None | Custom text `there` |

What each order gets:

| Order | Sent by | Message starts with |
| - | - | - |
| Cash on Delivery (COD), has a first name | Match cash | "Hello Sara, …" |
| Example Pay, has a first name | Match Example Pay | "Hello Sara, …" |
| Either method, no first name | Fallback | "Hello there, …" |
| Any other payment method | Fallback | "Hello there, …" |

The fallback sends to every order no rule sends to. To message only cash and Example Pay orders, turn the fallback off. So that orders without a first name still get a message, add a copy of each rule below it, with `{{1}}` set to Custom text `there`.

## Troubleshooting

> [accordion] Why didn't a customer get a WhatsApp message for their Shopify order?
>
> Check, in order:
>
> 1. The automation is **Active** on the AI agent connected to the store.
> 2. A rule's conditions match the order, or the fallback is on. For **Payment method**, compare your value with the order's gateway name. See [Payment method condition](#payment-method-condition).
> 3. The order has a value for every variable the matching template uses. A missing value skips that rule or the fallback.
> 4. The order has a valid phone number.
> 5. The template is still approved in WhatsApp Manager, and its header has no variables.
> 6. The workspace isn't HIPAA-compliant. Automations don't send there.

> [accordion] Why did my automation send the wrong WhatsApp template?
>
> An automation checks its rules from top to bottom, and the first match wins. Drag the more specific rule above the general one.

> [accordion] Why is my WhatsApp template missing from the template picker?
>
> The template picker lists only approved templates of the WhatsApp number in **Send from**. Check its status in WhatsApp Manager, or pick the number the template belongs to.

## Frequently asked questions

> [accordion] Can a WhatsApp automation message every new Shopify order, with no conditions?
>
> Yes. Turn on the fallback and leave out the rules. The fallback then sends on every order.

> [accordion] What kind of messages do WhatsApp automations send?
>
> Approved WhatsApp templates. WhatsApp requires businesses to start a conversation with an approved template, so every automation message uses one.

> [accordion] Does a new WhatsApp automation start sending right away?
>
> Yes. **Save & enable** creates it already active. To pause it, open it, turn off **Active** and save.

> [accordion] What happens to my WhatsApp automations if I disconnect Shopify?
>
> They're deleted. After reconnecting, create them again.

> [accordion] Do WhatsApp automations use Chatbase message credits?
>
> No. Sending an automation message doesn't use message credits. Meta bills template messages to your WhatsApp Business Account at its own rates.

> [accordion] Where can I see the messages a WhatsApp automation sent?
>
> In **Activity > Conversations**. Each message is added to the customer's WhatsApp conversation, so you see it alongside any replies.

> [accordion] Who can create, edit or delete WhatsApp automations?
>
> Owners and Members can create, edit and delete them. Viewers can see them, but every button that changes an automation is disabled. Custom roles need edit access to integrations to create or edit, and delete access to integrations to delete.

> [accordion] Are WhatsApp automations available on HIPAA-compliant workspaces?
>
> No. WhatsApp is blocked on HIPAA-compliant workspaces, so automations can't be created, edited or sent there. The **Automation** tab shows "Not available on HIPAA-compliant accounts."

> [accordion] Are changes to WhatsApp automations recorded in the audit log?
>
> Yes. Creating, editing, turning on or off, and deleting an automation each add an audit log entry with the object type **Channel** and the name **WhatsApp automation**. Audit logs are available on the Enterprise plan.

## Next steps

> [card] [WhatsApp Templates](https://chatbase.co/docs/user-guides/integrations/whatsapp-templates.md)
>
> Create and get approval for the templates your automations send.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.