Send a WhatsApp template
Step
whatsapp-send-templatenotifyside effectsSends a template Meta approved, with its values and buttons. It can start a conversation at any time.
At a glance
| Property | Value |
|---|---|
| Step name | whatsapp-send-template |
| Resource | ClusterStep (lumen.ai/v1alpha1) |
| Palette group, category | notify, messages |
| Credits | 1 credit each time it succeeds |
| Side effects | yes It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it. |
| Installation must provide | nothing |
Inputs
| Property | Value |
|---|---|
| Needs | nothing |
| Produces | fields |
| Works on | item one document at a time |
Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See Documents and data.
Outputs
A later node references an output as {nodeId.field} in text, or nodeId.field in a condition.
| Output | Type |
|---|---|
whatsappMessageId | string |
whatsappStatus | string |
Settings
Set under config: on the flow node. Text settings may contain {nodeId.field} placeholders.
| Setting | Type | Default | Description |
|---|---|---|---|
connectorRef | string | - | Send fromminLength 1 |
to | string | - | TomaxLength 200 |
toMember | string | - | Their email. They must have joined this number with their phone (Profile, WhatsApp).maxLength 320 |
templaterequired | string | - | Template is the approved template's name, as Meta has it.minLength 1; maxLength 512 |
languagerequired | string | - | Language is the template's language code, he or en_US.minLength 2; maxLength 15 |
params | list of string | - | Params fill the template's {{1}}, {{2}}, ... in order; each may hold placeholders.maxItems 20 |
buttonPayloads | list of string | - | ButtonPayloads are what the template's quick reply buttons send back when tapped, by position; each may hold placeholders.maxItems 10 |
The full JSON Schema of these settings: whatsapp-send-template.schema.json.
Example
Ask to approve a receipt
config
buttonPayloads:
- approve:{number}
- reject:{number}
connectorRef: whatsapp-main
language: he
params:
- '{number}'
- '{amount}'
template: receipt_ready
to: '{phone}'
Use it in a flow
A node that runs whatsapp-send-template goes under spec.nodes of a Flow. Give it any id, and list the next node ids in next.
flow.yaml (spec.nodes)
- id: whatsapp-send-template
stepRef: {name: whatsapp-send-template}
config:
buttonPayloads:
- approve:{number}
- reject:{number}
connectorRef: whatsapp-main
language: he
params:
- '{number}'
- '{amount}'
template: receipt_ready
to: '{phone}'
Was this page helpful?