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

# Trigger

> The Trigger block is the starting point of a chatbot flow. It allows WotNot to determine which bot should be triggered when multiple bots are configured.

![Trigger block](https://mintcdn.com/wotnot/KsQ-zr0VbihC7Wze/images/image-1.avif?fit=max\&auto=format\&n=KsQ-zr0VbihC7Wze\&q=85\&s=4cde0d96c8b0dc5384e797542813d897)

> [!NOTE]
>
> The Trigger block is available on all channels, although the available trigger conditions vary by channel. For example, **Page load** is available only on web, while **Inbound message received** applies to WhatsApp, SMS, and Instagram.

## Using the Trigger block

The Trigger block is added automatically when you create a flow. You do not need to add it manually.

Click the **Trigger** block to open its configuration panel and define what should start the conversation.

![Trigger configuration panel](https://mintcdn.com/wotnot/U-7FfmJOCeYvTynD/images/Screenshot-2026-08-13-163219.png?fit=max\&auto=format\&n=U-7FfmJOCeYvTynD\&q=85\&s=ace98f2c88dec65137fdce929fa7085a)

## Configurations

Configure the Trigger block based on how you want the conversation to start.

### Trigger type

The trigger types available depend on the channel where the bot is deployed.

You can configure triggers such as:

* **Page load** — Starts the bot when a visitor lands on a webpage.
* **User opens the widget** — Starts the conversation when a visitor opens the chat widget.
* **Inbound message received** — Starts the flow when a user sends a message to the bot.
* **Button click** — Starts the flow when a user clicks a configured button.

### Conditions

Use **Conditions** to restrict when a trigger should start the flow. Depending on the channel, you can configure conditions based on specific pages, URLs, user attributes, or other available criteria.

You can combine multiple conditions using **AND / OR** logic to create more precise trigger rules.

| Condition | Description |
| - | - |
| URL | Triggers the chatbot based on the webpage the user is visiting. For example, URL contains `pricing` or URL equals `https://wotnot.io`. |
| Browser language | Uses the user's browser language to trigger a chatbot. For example, Language is French. |
| Date Range | Activates the chatbot only within a specified date range. Useful for seasonal campaigns or special announcements. |
| Keyword | Available for WhatsApp and SMS. Triggers the flow when a user sends a specific keyword, such as `Book appointment`. |
| Button Payload | Available for WhatsApp and SMS. Triggers the flow when a user clicks a button on a template message sent by the business. |

> [!NOTE]
>
> **Conditions are optional.**
>
> If no conditions are configured, WotNot triggers the first active chatbot by default.

## Output paths

The Trigger block has a single output path that connects to the first block in your flow.

Connect the Trigger block to the block that should run immediately after the conversation starts.

For example:

**Trigger → Welcome message → Collect input → Condition**

![Trigger output path](https://mintcdn.com/wotnot/U-7FfmJOCeYvTynD/images/Screenshot-2026-08-13-163858.png?fit=max\&auto=format\&n=U-7FfmJOCeYvTynD\&q=85\&s=76decf8b7aa8ca5f2927786d973ae2ba)

If the Trigger block is not connected to another block, the flow has no action to execute after the trigger fires. The conversation will not proceed beyond the Trigger block.

## Contact subscription

> [!NOTE]
>
> This feature applies only to WhatsApp and SMS.

On channels such as WhatsApp and SMS, businesses can send messages to contacts, subject to the channel's rules and applicable consent requirements.

Businesses must maintain the subscription status of contacts to determine whether they have subscribed to or unsubscribed from receiving communications. This is similar to email subscription management.

> [card] SUBSCRIBED
>
> The contact can receive eligible promotional template messages sent by the business, subject to applicable messaging rules.

> [card] UNSUBSCRIBED
>
> The contact should not receive promotional template messages from the business.

Based on the conditions you define for the Trigger block, you can configure the contact's subscription status.

Generally, you should configure two chatbots:

* **Main chatbot:** Configured with the Subscribed status.
* **Acknowledgment chatbot:** Handles messages from users who type `STOP` to unsubscribe.

![Contact subscription configuration](https://mintcdn.com/wotnot/U-7FfmJOCeYvTynD/images/Screenshot-2026-08-14-104525.png?fit=max\&auto=format\&n=U-7FfmJOCeYvTynD\&q=85\&s=a5ce5024b3e7d8424da3e2864117318d)

## Inject data into the chatbot

Use this option to pass external data to the chatbot. Once enabled, you can map incoming data fields to WotNot variables.

[Inject data into the chatbot tutorial](https://www.loom.com/embed/fdb974a916004066aff4e555999e0318)

There are two ways to inject data into the chatbot.

> [tab] Using Query Params
>
> When the WotNot snippet loads on the website for the first time, the defined query parameters and their values can be stored in WotNot variables.
>
> For example, consider the following URL:
>
> `https://www.wotnot.io?cust_id=1234&plan=9896`
>
> You can map the values of `cust_id` and `plan` to WotNot variables in the Trigger block.
>
> ![Query parameter mapping](https://mintcdn.com/wotnot/YfQKl2QOkXpO0Wk_/images/image-81.png?fit=max\&auto=format\&n=YfQKl2QOkXpO0Wk_\&q=85\&s=10462dd1d7050a234799ace1c79aabea)
>
> > [!NOTE]
> >
> > **Important:**
> >
> > * WotNot reads this object when the code snippet is fired. Data added after the snippet loads will not be read automatically.
> > * Dynamically add the `data-session-payload` object to the WotNot code snippet when passing session data.
>
> > [!NOTE]
> >
> > For WhatsApp Meta Cloud, you can use the following object paths to store the selected button's payload, button text, or incoming text message in a WotNot variable within the Trigger block.
> >
> > * **Selected button payload:** `entry[0].changes[0].value.messages[0].button.payload`
> > * **Selected button text:** `entry[0].changes[0].value.messages[0].button.text`
> > * **Incoming text message:** `entry[0].changes[0].value.messages[0].text.body`

> [tab] Using JSON
>
> You can inject a JSON payload into the WotNot code snippet and map its fields to variables in the Trigger block.
>
> Add the `data-session-payload` attribute to your WotNot code snippet with the fields and values you want to pass.
>
> For example:
>
> ```html theme={null}
> <script
>   src="YOUR_WOTNOT_SCRIPT_URL"
>   data-session-payload='{"field1":"value1","field2":"value2"}'
>   defer
> ></script>
> ```
>
> Suppose you are using a chatbot in your web application and already know the identity of the user initiating the conversation. You can pass their name, phone number, customer ID, plan, and other relevant details so your agents have the necessary context.
>
> For example:
>
> ```html theme={null}
> <script
>   src="YOUR_WOTNOT_SCRIPT_URL"
>   data-session-payload='{"name":"Charles","phone":"8164848686"}'
>   defer
> ></script>
> ```
>
> In this example, the `name` and `phone` fields can be mapped to their corresponding WotNot variables in the Trigger block.
>
> ![JSON payload mapping](https://mintcdn.com/wotnot/YfQKl2QOkXpO0Wk_/images/image-87.png?fit=max\&auto=format\&n=YfQKl2QOkXpO0Wk_\&q=85\&s=88a11a9674be5de1823b9cdf39682173)


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