Skip to content

Bot Triggers

Every LeadPattern bot trigger with each setting explained: keywords, attribute and template filters, ad scopes, store events and calls, and when each fires.

15 min readUpdated Nov 5, 2026

A trigger is the event that starts a bot. Every bot has exactly one trigger, chosen when you create it (you can change it later from the Trigger type dropdown on the first node). When the event happens for a contact, the bot's flow begins.

Each bot starts from one trigger — browse them in the Triggers tab.

Rules that apply to every trigger

Read these once — they explain most "why didn't my bot run?" questions.

  • A bot must be active. New and copied bots start inactive. Turning a bot on fails if WhatsApp isn't connected yet or if the bot has validation errors (the error list tells you which node and field). Warnings never block activation.
  • All matching bots run. If three active bots match the same event, all three start. The one exception is Incoming WhatsApp Call, where only the first active bot runs.
  • A new run replaces a running one. If the same bot triggers again for the same contact while an earlier run is still running, the earlier run is marked stopped. Runs that are paused on a delay or wait are left alone.
  • Saving, deactivating or deleting a bot stops its in-progress runs, including paused ones.
  • Restricted workspaces don't run bots. If your workspace is suspended, billing-blocked or data-locked, no trigger starts a bot and queued runs stop.
  • Opted-out contacts are never messaged. Message nodes re-check the contact's opt-out status right before sending and skip themselves (the flow carries on down the normal output). Store triggers (WooCommerce, Shopify) skip opted-out contacts before the bot even starts.
  • Bots don't trigger bots. Tags, attributes, assignments and closes made by a bot don't fire the matching triggers, so flows can't loop.
  • Duplicates are suppressed. Most message-based triggers ignore a repeat of the same WhatsApp message for one hour. Store triggers have longer once-per-order rules, listed below.
  • Trigger data isn't a variable. Values such as the ad ID or call ID are recorded in the bot log but can't be inserted into messages. Store, QuickSell and Google Sheets triggers do expose their own variables — see each section.

Message triggers

On Message (on_message)

Starts when a customer sends a message.

FieldWhat it doesDefault
KeywordsA list of words or phrases. The bot starts only if the message matches any of them (OR). Add as many as you like.Empty — the bot starts on every message
Partial (checkbox on each keyword)Off = the whole message must equal the keyword. On = the keyword may appear inside the message as a whole word or phrase.Off

How matching works:

  • Matching ignores upper/lower case.
  • Exact (Partial off): the entire message must equal the keyword. hi matches "Hi" but not "hi there". Spaces are not trimmed, so a keyword with a trailing space will not match.
  • Partial (Partial on): the keyword must appear as a separate word or phrase. price matches "what is the price?" but not "priceless". A multi-word keyword such as track order matches only that exact phrase in that order.
  • There are no regular expressions, "starts with" or "ends with" options.
  • An empty keyword row never matches, and the validator reports it as an error.
  • Partial matching works on word boundaries, which only recognise plain letters and digits. A partial keyword that starts or ends with a symbol (#1) or a non-Latin script (such as Devanagari) won't match — use Exact for those.
  • For images, stickers and other non-text messages the text matched is the placeholder shown in the chat (for example "[Image received]"). Tapped buttons match on the button title.

Does not start the bot when:

  • the customer's message is an opt-out word (STOP, UNSUBSCRIBE, CANCEL, END) or the contact is opted out;
  • the message is a button/list/flow reply that a waiting bot consumed (see Interactive replies);
  • the message is a call-permission reply or a QuickSell Add to order tap;
  • the message came from a Click-to-WhatsApp ad that a CTWA bot handled (see CTWA triggers).

On First Daily Message (on_first_daily_message)

Starts when a customer messages you and nothing has been sent or received in that conversation yet today. No settings.

  • "Today" is the calendar date on the LeadPattern server, not your workspace timezone.
  • The comparison uses the conversation's last message time, which includes messages you sent. If a broadcast, agent or bot messaged the contact earlier today, their reply is not "the first".
  • A brand-new contact's first message fires this trigger, On Message and On New Lead together.

On No Keyword Match (on_no_keyword_match)

A fallback. Starts when an incoming message started no On Message bot. No settings.

  • It fires when no On Message bot is active at all, or when active ones exist but none matched.
  • It never fires if you have an On Message bot with no keywords, because that bot matches everything. The validator flags this as "trigger never fires".
  • It does not fire for a reply that resumed a waiting button/list/flow, a call-permission reply or an Add to order tap.
  • It fires for non-text messages too (images, voice notes, stickers).

Lead and contact triggers

On New Lead (on_new_lead)

Starts the first time an unknown number messages you. No settings.

  • Only customer-initiated first messages count. Contacts created by an agent, the API, an import, a WooCommerce/Shopify event or an incoming call do not fire it.
  • A contact whose very first message is an opt-out word does not fire it.
  • For ad clicks, a CTWA bot takes priority — see below.

On Agent Assign (on_agent_assign)

Starts when a chat is assigned to a team member. No settings.

  • Fires for manual assignment in the inbox, the public API's assign endpoint, and when an agent's first reply automatically claims an unassigned chat.
  • Assigning again to the same agent fires it again. Unassigning doesn't fire it.
  • Auto-assignment by working-hours rules and the bot Assign agent action don't fire it.
  • The agent's identity isn't passed to the flow, so use a condition or attribute if you need it.

On Attribute Change (on_attribute_change)

Starts when a custom attribute is edited on a contact.

FieldWhat it doesDefault
Attribute to watchPick one custom attribute, or leave on Select Attribute to react to any attribute.Any attribute

This trigger has three outputs instead of one — connect only the ones you need:

OutputFires when
Set 1st TimeThe contact didn't have this attribute and now does
ChangedThe contact already had the attribute and it was saved again
RemoveThe value was cleared

Details to know:

  • It fires from an agent (or API) editing one contact's attribute. Changes made by a bot's Set / remove attributes action, bulk edits and imports don't fire it.
  • Changed fires on every save, even if the new value equals the old one.
  • If the watched attribute is later deleted, the bot can't be activated until you pick another.

Conversation triggers

On Open Conversation (on_open_conversation)

Starts when a closed conversation becomes open again. No settings.

  • An agent or API call changes the status from closed to open (repeating the same status does nothing), or
  • the customer messages a chat that is currently closed.
  • A brand-new contact doesn't fire it.

On Close Conversation (on_close_conversation)

Starts when a conversation changes to closed by an agent or the API. No settings. A natural place for a satisfaction follow-up.

The bot Close conversation action does not fire it — otherwise a bot could trigger itself.

On Template Delivered (on_template_delivered)

Starts when WhatsApp reports that a template message was delivered.

FieldWhat it doesDefault
TemplateRun only for this template. Any Template matches all. The name is matched exactly (case-sensitive); language isn't considered.Any Template
  • Fires on the sent → delivered step, once per message.
  • Counts template messages sent by agents, broadcasts, scheduled sends, the API and store automations. Templates sent by a bot never fire it, so bots can't chain themselves.
  • If the chosen template has quick-reply buttons, the node gets an extra On Delivery output plus one output per button. On Delivery runs immediately; each button output runs when the customer taps that button (for up to 24 hours).
  • If you delete the template, the bot reports an error until you choose another.

Click-to-WhatsApp ad triggers

These start when a chat begins from a Click-to-WhatsApp ad (the message carries an ad referral). They are always shown in the palette. Pair them with Ads Insights to see what each ad lead cost, and with Meta Conversions to report outcomes back to Meta.

Lead from CTWA (on_ctwa_lead)

FieldWhat it doesDefault
Facebook ad accountThe connected ad account whose ads count. Use Connect to Facebook (or Connect another ad account) if none is listed. Required.—
Track leads fromThe scope: Entire ad account, Specific campaigns, Specific ad sets or Specific ads. Appears once an account is chosen.Entire ad account
Select campaigns / ad sets / adsTick the items to track. Lists over 8 items get a search box; campaign and ad-set filters narrow the ad list. At least one item is required for a scoped option.None
  • Changing the ad account resets the scope.
  • An item that no longer exists on Meta is shown as "(not found on Meta)".
  • The ad must resolve to the selected account through your Facebook connection. If LeadPattern can't resolve the ad (for example, the connection expired), this trigger is skipped for that message.
  • Fires on every message that carries the ad referral, not once per contact.

Message from CTWA (on_ctwa_message)

Starts for any Click-to-WhatsApp ad message. No settings, and no ad account connection is needed. Use it as the catch-all for ad traffic.

Which bot wins for an ad message

An ad message runs a chain, and stops at the first step that starts at least one bot:

  1. Lead from CTWA (if the ad resolved to a connected account),
  2. Message from CTWA,
  3. the regular On Message, On First Daily Message and On New Lead bots.

If a CTWA bot runs, the regular message triggers are skipped for that message. The chat also stores the ad it came from on the contact.

Call triggers

Incoming WhatsApp Call (on_incoming_call)

Starts when a customer calls your number. No settings.

  • It replaces the default behaviour of ringing every agent. If no active bot uses this trigger, calls ring all eligible agents as usual.
  • Only the first active Incoming Call bot runs, once per call.
  • The flow is built around the Incoming Call action, which rings agents using the method you choose and branches on answered / not answered. See Integration actions.
  • If calling isn't available or the workspace is restricted, the call is rejected and no bot runs.

Call Permission Granted (on_call_permission_granted)

Starts when a customer accepts your request to call them — either temporarily or permanently, including when they grant it from your business profile. No settings. Declines and revocations don't fire it.

E-commerce triggers

Connect the store first in Integrations. A store trigger only appears in the palette when the store is connected (and, for WooCommerce, when that event is registered).

WooCommerce

No settings on any of these triggers.

TriggerStarts whenOnce per order?
Order created (on_wc_order_created)A new order is placedYes, for 30 days
Order updated (on_wc_order_updated)Any update to an orderNo
Order completed (on_wc_order_completed)An update sets the status to completedYes
Order cancelled (on_wc_order_cancelled)An update sets the status to cancelledYes
Order deleted (on_wc_order_deleted)An order is deletedNo
Order restored (on_wc_order_restored)A deleted order is restoredNo
New customer (on_wc_new_customer)A customer account is createdNo
Abandoned cart (on_wc_abandoned_cart)An order stays pending or failed for 30 minutes (workspace default; 5–1440)Yes
  • An Order updated event that sets the status to completed or cancelled fires both the update trigger and the completed/cancelled trigger.
  • Abandoned cart is worked out by LeadPattern: when an order is created or updated as pending or failed, a check is queued; if the order is still pending or failed when it runs, the bot starts. No extra plugin is needed despite what the tooltip says.
  • The customer needs a valid phone number on the billing or shipping address; otherwise the event is dropped. Opted-out contacts are skipped, and historical sync imports never start bots.
  • Order values go into templates with the wc: fields (city, email, state, country, orderId, address1, address2, postCode, products, invoiceUrl, totalPrice, orderStatus, paymentMethod, currencySymbol) through the template variable picker. They can't be typed into free-text messages.

Shopify

Requires the Shopify add-on. No settings on the trigger.

TriggerStarts whenNotes
Abandoned checkout (on_shopify_abandoned_checkout)A checkout has had no activity for the wait timeDefault wait 30 minutes unless an abandoned-checkout automation on the Shopify page sets another delay. Each new update from the customer restarts the wait. Skipped if the checkout completes or an order is placed from it.
Order placed (on_shopify_order_created)An order is created (includes cash on delivery)Skipped if the order is cancelled or refunded before the bot runs.
Order fulfilled (on_shopify_order_fulfilled)An order is fully fulfilledPartial shipments don't fire it.
  • Each order or checkout starts a bot once (for 30 days), even if Shopify re-sends the event.
  • The customer needs a phone number on the order, customer or an address; opted-out contacts are skipped.
  • Use {{shopify:KEY}} in messages and template mappings. Available keys: customer.first_name, customer.last_name, customer.email, billing_address.first_name, billing_address.last_name, billing_address.phone, shipping_address.first_name, shipping_address.phone, shipping_address.city, order_number, order_name, total_price, currency, line_items.0.title, line_items.summary, order_status_url, abandoned_checkout_url, fulfillment_status, tracking_number, tracking_url, tracking_company.
  • The bot cannot be activated until Shopify is connected.

QuickSell — Product Added to Cart (on_quicksell_add_to_cart)

FieldWhat it doesDefault
CatalogueRun only when the product came from this catalogue.Any catalogue

Starts after a customer taps Add to order on a product you sent and LeadPattern successfully adds it to their cart (and replies with the cart). If adding fails, the customer gets an apology message and the bot does not start. Contacts without a phone number (username-only contacts) can't use carts. Variables: {{quicksell:KEY}} with product_name, product_price, product_id, catalogue_name, catalogue_id, cart_items, cart_total, cart_summary, cart_link, order_id. See Send Catalogue.

Google Sheets — On New Row Google Sheet (on_google_sheet_row)

FieldWhat it doesDefault
Google accountThe connected Google account that can open the sheet.—
Spreadsheet / SheetThe spreadsheet (listed from the Google account's Drive — use Refresh to reload the list) and the tab to watch.First tab
Use first row as headerColumns are named by row 1 (Name, Phone Number…) instead of letters.On
Phone number fieldThe column with the customer's WhatsApp number. Required.—
Country / Username (BSUID) / Customer ID fieldOptional extra columns saved on new contacts.Not used

Starts for each new row with a phone number, about a minute after it's added. Rows already in the sheet when the bot is turned on are ignored, and so is a row that repeats one already handled. A row without a phone number is retried for 10 minutes. Variables: {{gsheet:<column>}} for every cell of the row. See Google Sheets.

How trigger priority works

For a normal incoming message, LeadPattern decides in this order:

  1. Waiting reply. If a bot is waiting for a button, list or flow reply and the customer's tap matches, that bot resumes and On Message bots are skipped for the message. If it doesn't match, the message is handled normally.
  2. Click-to-WhatsApp chain, for ad messages (above).
  3. On Message bots (keyword matched).
  4. If none of those started a bot, On No Keyword Match bots.

What's next

Was this article helpful?

Your feedback helps us continuously improve our documentation.

Need more help with this topic?Ask LeadPattern Support

Related Articles