# 33 · Workflow triggers: what can start a flow

**Purpose:** pick the right **Starts when** for a workflow and set its options: which messages, numbers, leads, tags, labels, broadcasts, pages, ads, hooks, calls and shop orders start it, and how to start one by hand.

## Before you start

- You need to be an **owner** or **admin** to change a trigger or start a workflow by hand. Agents see the trigger card greyed out.
- A workflow to work on. Building the steps is in [04 · Chatbot and workflows](https://wsapme.com/guides/chatbot-workflows.md); this guide is only about the **Trigger** card.
- Triggers that come from an integration (Meta Lead Ads, TikTok Shop, Bizapp, WooCommerce, Instagram and Messenger) need that integration connected first (see [08 · Integrations](https://wsapme.com/guides/integrations.md)).
- A trigger does nothing until you click **Save** under it and the workflow is switched on.

> In this guide every trigger was chosen on a draft workflow called "Demo: Pemicu workflow" and **never saved**, and the workflow was never switched on, so nothing was started or sent. The workspace has no incoming hook, no Meta lead form and no connected shop, so those cards show their "connect first" text. Screenshots use a demo workspace with Demo mode on.

**Watch first (3:51, Malay narration):** [Workflow triggers: what can start a flow](https://wsapme.com/guide-media/video/33-workflow-triggers-reference-malay.mp4). Most Starts when choices on a draft workflow, with the keyword match modes, numbers and cooldown, Send from, and the lead, tag, label, broadcast, page, ad, hook, call and shop triggers; nothing is saved or sent in the video.

## Part 1 · Where the trigger is set

1. In the sidebar, click **Workflows** and open a workflow.
2. The **Trigger** card is on the left: "When the flow starts. A chat runs one flow at a time; replies from your team stop it."
3. Click **Starts when** and pick a trigger. The card changes to show that trigger's options.

   ![The Starts when list on the Trigger card](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/01-starts-when-list.webp)

4. Set the options (the parts below), then click **Save**. You see "Workflow saved." The line under the workflow's name sums the trigger up, for example `Message contains "harga"`.

The triggers fall into three groups:

| Group | Triggers | Which number writes |
|---|---|---|
| A message comes in | **Message contains a keyword**, **First message from a new contact**, **Any message (when no other flow matches)** | The number the message came in on. You choose which numbers listen. |
| You start it | **Started by hand** | The number you choose when you start it. |
| Something happens in Wsapme | Every other trigger (leads, tags, labels, broadcasts, follow-ups, sales pages, ads, hooks, calls, shop orders) | **Send from** (Part 7). An **Incoming call** flow writes from the number that was called, and **Comment on a post** replies in Instagram or Messenger, not WhatsApp. |

Every trigger also has **Add notes to the inbox when the bot decides** (ticked by default): a short note in the chat for Detect intent, Go to another workflow, and when no reply starts a workflow or follow-up. Only your team sees these notes.

## Part 2 · Message contains a keyword

The flow starts when a customer's message matches one of your words.

1. In **Starts when**, choose **Message contains a keyword**.
2. Under **Keywords**, choose how a word must match:

   | Choice | Starts when the message… | Example with the word "harga" |
   |---|---|---|
   | **Contains the word** | has the word as a whole word, anywhere | "Boleh tahu harga?" yes; "hargai" no |
   | **Is exactly** | is the word and nothing else | "Harga" yes; "harga kek" no |
   | **Starts with** | begins with these letters | "harga kek" yes; "Hargai" also yes |
   | **Matches a regular expression** | matches a pattern (Part 3) | |

3. Type the words in the box, one per line (for example `harga`, `price`, `berapa`). Case doesn't matter, and a word can be a short phrase such as `harga kek`. Up to 20 keywords.

   ![Message contains a keyword with three keywords](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/02-keyword.webp)

4. Click **Save**. Saving without a keyword gives "Add at least one keyword."

Commas also separate keywords, so `harga, price` is two keywords.

## Part 3 · Keywords as a regular expression

Use **Matches a regular expression** when a fixed word is not enough, for example an order number.

1. Under **Keywords**, choose **Matches a regular expression**.
2. Type one pattern per line, for example `order\s*#?\d+` (the word "order" followed by a number) or `^(harga|price)\b` (a message that begins with either word). Case is ignored.
3. Click **Save**. A pattern that is not valid is refused with "… is not a valid regular expression."

   ![Two regular expressions as keywords](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/03-keyword-regex.webp)

> Because commas separate keywords, a pattern cannot contain a comma: write `\d\d?\d?` instead of `\d{1,3}`.

## Part 4 · First message from a new contact and Any message

**First message from a new contact** starts on the very first message a contact ever sends you, on any of your numbers. A contact you imported or added by hand still counts as new until they write for the first time.

**Any message (when no other flow matches)** is the catch-all: it starts on any message that no keyword or new-contact flow took.

For each incoming message (when no flow is already running in that chat), Wsapme checks in this order and starts the first one that fits:

1. **Message contains a keyword** flows, the oldest first.
2. **First message from a new contact** flows.
3. **Any message** flows.

A flow is skipped when it is not on that number (Part 5) or still in its cooldown for that contact.

> Give an **Any message** flow a cooldown, for example **720** minutes (12 hours), or it starts again on every message after it ends. The box shows 720 only when **Any message** is already the saved trigger; when you switch a workflow to **Any message**, the box keeps its old value (often 0), so type it yourself.

## Part 5 · Which numbers, number groups and the cooldown

These options are under the trigger for the three message triggers.

- **WhatsApp numbers**: tick the numbers this flow listens on. "None ticked = all numbers." (The list only shows when the workspace has more than one number.)
- **Don't start again for the same contact within (minutes)**: after the flow starts for a contact, it does not start for them again until this many minutes have passed. 0 means no limit; the most is 43200 (30 days). Event triggers have the same box.

  ![The WhatsApp numbers and the cooldown box, with 720 typed in](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/04-numbers-cooldown.webp)

*From the documentation, not captured* (the demo workspace has no number groups): in a Fleet workspace with number groups, the numbers are chosen under **Runs on**: **All numbers** ("Every WhatsApp number of the workspace, including numbers added later."), **Selected numbers**, or **Number groups** ("The numbers in these groups when a message comes in."). A group covers the numbers in it now and later. See [11 · Fleet](https://wsapme.com/guides/fleet.md).

## Part 6 · Started by hand, Start for a contact and Start workflow in a chat

**Started by hand** never starts by itself. Its card has no numbers and no cooldown.

![Started by hand](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/05-started-by-hand.webp)

You can start any workflow that is switched on by hand, whatever its trigger, in two places. *From the documentation, not captured: the demo workflow was never switched on, and Start for a contact only appears once it is.*

**From the workflow page:**

1. Switch the workflow on.
2. Click **Start for a contact** next to **Switch off**.
3. Type the **Contact's WhatsApp number**. The contact must already exist ("No contact has this number yet. Add the contact first.").
4. If you have more than one number, choose **From**.
5. Click **Start**. You see "Workflow started for …", or "… is already in a workflow on this number." On official numbers the contact must have written in the last 24 hours.

**From a chat in the Inbox:**

1. Open the chat, click the arrow next to **Close** (**More status options**) and click **Start workflow**.
2. In the **Start a workflow** window, choose the workflow (workflows with **Started by hand** are marked "(manual)") and click **Start**. "The bot takes over this chat until it ends, or until someone on the team replies."

With no workflow switched on, the window says "No workflow is switched on. Create one on the Workflows page." Only one-to-one chats on a connected number can run a workflow, and only owners and admins see **Start workflow**.

## Part 7 · Rules for every event trigger (Send from)

Every trigger from Part 8 on starts because something happened, not because of a message. They share these rules, except that **Incoming call** (Part 16) has no **Send from** box (it writes from the number that was called) and **Comment on a post** (Part 21) does not use a WhatsApp number:

- **Send from** chooses the number the flow writes from. Leave **The number they last chatted with** to use the number of the chat, broadcast, follow-up, hook or shop the event came from, or else the number the contact last chatted with. Or pick one number.
- "Contacts who never chatted with you are skipped. Official numbers can only message inside the 24-hour window."
- The flow is also skipped when the chat already runs a flow, when your team has taken over the chat, when the contact has opted out or is archived, or within the cooldown.
- When several switched-on workflows have the same trigger, only the oldest one whose options match starts.
- A flow never starts itself again through something it did (for example a tag it added), and flows that start each other stop after five in a row.

## Part 8 · A lead is created, moves to a stage or gets a new owner

| Trigger | Options |
|---|---|
| **A lead is created** | **Pipeline** (only when you have more than one): **Any pipeline** or one. |
| **A lead moves to a stage** | **Pipeline**, and **Stages**: "None ticked = any stage." |
| **A lead gets a new owner** | **New owner**: tick members. "None ticked = anyone." Removing the owner does not start it. |

![A lead moves to a stage, with Stages and Send from](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/06-lead-stage.webp)

In messages you can use `{{lead_title}}`, `{{lead_stage}}` and `{{lead_pipeline}}`. **A lead is created** does not start for leads from a contact import whose **Start workflows** option is off (see [12 · Contacts](https://wsapme.com/guides/contacts-tags-segments-import.md)).

## Part 9 · A tag is added to a contact

1. Choose **A tag is added to a contact**.
2. Under **Tags**, type one tag per line, for example `VIP`. "Empty = any tag."

![A tag is added to a contact, with the tag VIP](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/07-tag-added.webp)

It starts whenever the tag is added to the contact, for example by hand or by another workflow. Tags given by a contact import count only when the import's **Start workflows** option is on. Merging two tags does not count.

## Part 10 · An inbox label is added to a chat

1. Choose **An inbox label is added to a chat**.
2. Under **Labels**, tick labels. "None ticked = any label. The flow writes from that chat's number."

![An inbox label is added to a chat](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/08-label-added.webp)

Group chats and website chats never start it. The label's name is available as `{{label}}`.

## Part 11 · Someone replies to a broadcast, clicks a link, or a broadcast converts

| Trigger | Starts when | Extra placeholder |
|---|---|---|
| **Someone replies to a broadcast** | A recipient answers the broadcast. | `{{reply}}` (their message) |
| **Someone clicks a link in a broadcast** | A recipient opens a tracked link in it. | `{{link}}` |
| **A broadcast converts (its goal is met)** | The goal you set on the broadcast is reached for that recipient (see [03 · Broadcast and follow-ups](https://wsapme.com/guides/broadcast-and-followups.md) and guide 30, Every option when you write a broadcast). | |

Under **Broadcasts**, tick broadcasts: "None ticked = any broadcast. The flow writes from the broadcast's number." `{{broadcast}}` is the broadcast's name.

![Someone replies to a broadcast](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/09-broadcast.webp)

## Part 12 · A contact finishes a follow-up

1. Choose **A contact finishes a follow-up**.
2. Under **Follow-ups**, tick sequences. "None ticked = any follow-up."

![A contact finishes a follow-up](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/10-followup-finished.webp)

It starts when the contact reaches the end of the sequence. "Stops for replies or opt-outs don't count. A flow is never started again by a follow-up it enrolled the contact in." `{{followup}}` is the sequence's name. Follow-ups are in [03 · Broadcast and follow-ups](https://wsapme.com/guides/broadcast-and-followups.md) and guide 32, Follow-up sequences in depth.

## Part 13 · A sales page form is submitted

1. Choose **A sales page form is submitted**.
2. Under **Sales pages**, tick pages. "None ticked = any sales page."

![A sales page form is submitted](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/11-sales-page.webp)

"Form answers can be used in messages, e.g. {{your_name}}": each question's label becomes a placeholder in small letters with underscores. `{{sales_page}}` is the page's title, and a booking form also gives `{{booking_at}}`.

## Part 14 · Came from an ad or link

1. Choose **Came from an ad or link**.
2. Under **Ads and links**, tick ads or tracked links. "None ticked = any ad or link."

![Came from an ad or link](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/12-ad-or-link.webp)

It "Starts once per chat, on the first message that came from it." Placeholders: `{{ad_source}}`, `{{ad_platform}}`, `{{ad_headline}}`. Ads appear in the list after their first Click-to-WhatsApp message; tracked links after you create them under **Ads** (see [06 · Sales pages, Ads and the lead pipeline](https://wsapme.com/guides/sales-ads-leads.md) and guide 37, Ads: tracked links, TikTok and Meta Lead Ads step by step).

## Part 15 · An incoming hook is received

An incoming hook is a web address that another system (a form, a shop, Zapier) calls to start flows.

1. Create the hook first under **Developers → Incoming hooks** (see [07 · API, webhooks and AI assistants](https://wsapme.com/guides/api-webhooks-mcp.md)). Until then the card says "No incoming hooks yet: create one under Developers → Incoming hooks."
2. Choose **An incoming hook is received** and tick hooks under **Hooks**. None ticked = any hook.

![An incoming hook is received, with no hook yet](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/13-incoming-hook.webp)

*From the documentation, not captured:* the hook's fields become placeholders: `order.id` becomes `{{hook_order_id}}`, `billing.first_name` becomes `{{hook_billing_first_name}}`, and `{{hook}}` is the hook's name.

## Part 16 · Incoming call (missed or declined)

1. Choose **Incoming call (missed or declined)**.
2. Under **Call result**, tick **Missed (nobody picked up)**, **Declined by Wsapme (automatic reject)**, or neither for both.
3. Under **Numbers**, tick numbers. "None ticked = every QR number. Official numbers do not get call events."

![Incoming call, with Call result and Numbers](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/14-incoming-call.webp)

It "Starts once per call, when it ends unanswered; calls answered on the phone never start it. Wsapme cannot answer calls." The flow writes from the number that was called. Placeholders: `{{call_status}}`, `{{call_time}}`, `{{call_type}}`.

## Part 17 · Meta lead form submitted

1. Connect a Facebook Page under **Settings → Integrations → Meta Lead Ads** (see [08 · Integrations](https://wsapme.com/guides/integrations.md)). Until then the card says "No lead forms yet: connect a Facebook Page under Settings → Integrations → Meta Lead Ads."
2. Choose **Meta lead form submitted** and tick forms under **Lead forms**. None ticked = any form.

![Meta lead form submitted, before a Page is connected](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/15-meta-lead-form.webp)

*From the documentation, not captured:* it starts once per lead. Placeholders: `{{meta_first_name}}`, `{{meta_full_name}}`, `{{meta_form}}`, `{{meta_ad}}`, `{{meta_campaign}}`, `{{meta_platform}}`, and each answer as `{{meta_<question>}}`, for example `{{meta_city}}`.

## Part 18 · TikTok Shop order event

1. Connect the shop under **Settings → Integrations → TikTok Shop** (see [08 · Integrations](https://wsapme.com/guides/integrations.md)).
2. Choose **TikTok Shop order event** and tick **Order events**: **Order created**, **Paid**, **Awaiting shipment**, **Shipped**, **Delivered**, **Cancelled**. None ticked = any event.

![TikTok Shop order event](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/16-tiktok-shop.webp)

It starts only for buyers whose phone number TikTok Shop shares. Placeholders: `{{tiktok_order_id}}`, `{{tiktok_status}}`, `{{tiktok_items}}`, `{{tiktok_total}}`, `{{tiktok_tracking}}`, `{{tiktok_courier}}`, `{{tiktok_buyer_name}}`, `{{tiktok_shop}}`.

> Order updates only: TikTok Shop does not allow marketing to its buyers.

## Part 19 · Bizapp order event

1. Connect Bizapp under **Settings → Integrations → Bizapp** (see [08 · Integrations](https://wsapme.com/guides/integrations.md)).
2. Choose **Bizapp order event** and tick **Order statuses**: **New order**, **Processing**, **Shipped**, **Out for delivery**, **Delivered**, **Returned**, **Cancelled**. None ticked = any status.

![Bizapp order event](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/17-bizapp.webp)

It starts for customers with a phone number. Placeholders: `{{bizapp_order_no}}`, `{{bizapp_status}}`, `{{bizapp_package}}`, `{{bizapp_amount}}`, `{{bizapp_courier}}`, `{{bizapp_tracking_no}}`, `{{bizapp_tracking_url}}`, `{{bizapp_name}}`, `{{bizapp_address}}`, `{{bizapp_team_sale}}`, `{{bizapp_agent_id}}`.

## Part 20 · WooCommerce order event

Choose **WooCommerce order event**, then tick **Order statuses** and optionally fill **Order total at least (optional)** and **Order contains the product (optional)**. With more than one store you can also tick **Stores**. Until a store is connected the card says "Connect a store first: Settings → Integrations → WooCommerce."

![WooCommerce order event, before a store is connected](https://wsapme.com/guide-media/img/33-workflow-triggers-reference/18-woocommerce.webp)

It starts once per order and status. The full steps and placeholders are in [17 · WooCommerce](https://wsapme.com/guides/woocommerce.md).

## Part 21 · Comment on an Instagram or Facebook post

The last choice, **Comment on an Instagram or Facebook post**, starts a flow in an Instagram or Messenger chat when someone comments, filtered by **Accounts**, **Posts** and **Keywords (optional)**. It only works in the canvas and must begin with the step "Reply privately to comment". It is explained in [18 · Instagram and Messenger in your inbox, and automatic replies to post comments](https://wsapme.com/guides/instagram-messenger-and-comment-replies.md).

## Common problems

| Problem | What to do |
|---|---|
| The flow does not start on a keyword | Check the workflow is switched on, the match choice (**Is exactly** needs the whole message), that the number is ticked or none are, and the cooldown. Another flow may already be running in that chat, or an older keyword flow matched first. |
| A short keyword such as "hi" starts the flow on "hilang" | That happens with **Starts with**: the message only has to begin with the keyword. Use **Contains the word** (whole words only) or **Is exactly** for short words. |
| A regular expression with `{1,3}` stops working after saving | Commas split keywords. Write the pattern without a comma. |
| An **Any message** flow answers every message | Give it a cooldown, for example 720 minutes. |
| An event trigger never starts | The contact must have chatted with you before, must not be opted out, and no other flow or team member may be handling the chat. On an official number the last message must be within 24 hours. |
| **Start for a contact** is missing | It only shows once the workflow is switched on, and only to owners and admins. |
| "No contact has this number yet. Add the contact first." | Add the contact under **Contacts**, then start the flow again. |
| A shop or lead form trigger shows "connect first" | Connect the integration under **Settings → Integrations**. |

## Related

- [04 · Chatbot and workflows](https://wsapme.com/guides/chatbot-workflows.md)
- [08 · Integrations](https://wsapme.com/guides/integrations.md)
- [10 · Test a chatbot with a tester number and Clear chat](https://wsapme.com/guides/testing-chatbots.md)
- [17 · WooCommerce](https://wsapme.com/guides/woocommerce.md)
- [18 · Instagram and Messenger in your inbox, and automatic replies to post comments](https://wsapme.com/guides/instagram-messenger-and-comment-replies.md)
- Guide 34, Workflow steps reference, and guide 35, Run and maintain workflows: versions, stats and runs
