> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/whatsapp-components/whatsapp-hsm.md).

# WhatsApp HSM

### Overview

The **WhatsApp Prebuilt Message Sending Component** (popularly known as `whatsapp_hsm`) is an action node focused on triggering structured and proactive notifications for contacts. Its main function is to transmit pre-approved business message templates by Meta (*Highly Structured Messages - HSM*) outside the standard 24-hour conversation window, allowing the sending of alerts, billing reminders, status updates, and re-engagement messages.

**Block by Open Support Case Rule:** To avoid logical interference or interruptions in the workflow of human operators, the component has a native safety lock: the system performs a preliminary scan and, if the destination number **already has an open ticket or human support case**, the HSM **will not be sent**. To force the trigger in a priority manner and independently of the contact's current status, it is mandatory to explicitly enable the component's bypass parameter.

### Configuration Parameters

The component configuration connects the Meta account to the flow variables, divided according to the following criteria:

* **Connection:** Dropdown menu to select which WhatsApp Business API account or official number the active notification will be sent through to the recipient. *(It is recommended to use fictitious or standardized channel names in the design environment).*<br>
* **Template:** Allows you to choose which of the Meta-approved and validated templates in the business account will be used (e.g.: `teste_var`).<br>
* **Variables (Body):** Dynamic input fields generated dynamically based on the placeholders in the selected template (e.g.: `{{1}} *`). They are used to fill in the personalized information that will be injected into the sent message.<br>
* **Department / User / Campaigns (Assignment and Traceability):** Optional menus to link the ticket generated by the trigger to a specific support queue, a fixed agent, or an internal marketing campaign for analytics reporting purposes.<br>
* \_*Send to (* Required Field):\_\* Numeric input field containing the recipient's phone number (with area code) that will receive the trigger. Accepts static values or flow variable injection.<br>
* **Do Not Open Support Case (Toggle Switch):** Critical control parameter. When **disabled**, sending the HSM automatically opens a ticket in the panel if the customer replies. When **enabled**, the system sends the notification as an isolated trigger (pure notification) and ignores the safety lock, ensuring the content is delivered even if the contact has an open support case with a human.<br>
* **Multiple Outputs (Toggle Switch):** When enabled, it changes the block morphology in the visual flow editor, providing distinct branching ports based on delivery and read statuses or interactions with the post (such as clicks on the template's quick reply buttons).<br>

### Visual Builder

The builder dynamically adapts its graphical interface in real time, serving as a validation assistant before sending:

* **Integrated Preview Module:** When selecting a template in the field *Template*, the interface renders a display box simulating exactly how the message will appear on the end customer's device, showing the variable placeholders (e.g.: `Good morning, I am {{1}}, how are you?`).<br>
* **Dynamic Input Form:** The block detects how many data placeholders exist in the body, header, or footer of the Meta template and generates a required text-type field (`*`) for each one in the block *Variables*, ensuring that no message is sent with empty or broken sections.<br>

### Special Operators

The logical properties of this component manage data interpolation with Meta's servers and response routing:

* **String Tokenization for Variables:** The variable input fields accept both fixed text values and data tags from the flow itself (e.g., inject the variable `{{cliente.nome}}` into the placeholder field `{{1}}`). At trigger time, the engine compiles this payload and sends it structured to the WhatsApp API.<br>
* **Trigger by Button Interaction (Quick Replies):** If the Meta-approved template has quick reply buttons and the parameter *Multiple Outputs* is active, each button becomes a physical connection line in the flow editor. This allows you to design automation paths conditioned on which button the user clicked when replying to the HSM.<br>

### Practical Examples

The table below demonstrates the component's behavior in different operational delivery scenarios:

| **Selected Template** | **Variable Injected into {{1}}** | **Status of the "Do Not Open Support Case" Key** | **Customer Status in the Dashboard**    | **System Behavior**                                                                                                                    |
| --------------------- | -------------------------------- | ------------------------------------------------ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `teste_var`           | `Test Agent`                     | **Disabled (Default)**                           | No open tickets.                        | **Success:** The message is delivered and, if the customer replies, a new support case is created on the platform.                     |
| `teste_var`           | `Test Agent`                     | **Disabled (Default)**                           | Being assisted by technical support.    | **Sending Blocked:** The system aborts the HSM trigger so as not to violate the support case that is already being handled by a human. |
| `aviso_cobranca`      | `Amount: R$ 150.00`              | **Enabled**                                      | Being assisted by the sales department. | **Forced Sending:** The system ignores the open ticket and delivers the billing notification seamlessly to the customer's device.      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/whatsapp-components/whatsapp-hsm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
