A WhatsApp message arrives
whatsapp-message-receivedStarts when someone writes to your WhatsApp number or taps a button you sent, with what they wrote, who they are, and any picture or file they attached.
At a glance
| Property | Value |
|---|---|
| Trigger name | whatsapp-message-received |
| Resource | ClusterTrigger (lumen.ai/v1alpha1) |
| Source | event |
| Needs a connection | yes, one that provides whatsapp |
| Produces | text, fields, file |
| Emits | item |
| Installation must provide | nothing |
A flow using this trigger names a Connector in connectorRef. Connection types that provide whatsapp: [WhatsApp (Meta Cloud API)](/reference/connections/whatsapp-cloud), [WhatsApp (app's shared number)](/reference/connections/whatsapp-shared).
The trigger goes under spec.triggers of a Flow. Its outputs are referenced as <triggerId>.<field>. A trigger can also carry a when condition ("Start only when") and disabled: true.
Outputs
A later node references an output as {nodeId.field} in text, or nodeId.field in a condition.
| Output | Type |
|---|---|
from | string |
name | string |
message | string |
kind | string |
buttonId | string |
mediaType | string |
mediaCount | number |
mediaError | string |
conversationId | string |
sessionId | string |
messageId | string |
connection | string |
receivedAt | string |
Settings
Set under config: on the flow trigger.
| Setting | Type | Default | Description |
|---|---|---|---|
only | string | "all" | Only limits which messages start the flow: every message, only text, or only a tapped button.one of all, text, buttons |
from | list of string | - | From limits the senders, by phone number with country code; empty is anyone.maxItems 50 |
showTyping | boolean | true | Marks their message read (blue ticks) and shows typing until the flow's first WhatsApp answer, for up to about a minute and a half. |
The full JSON Schema of these settings: whatsapp-message-received.schema.json.
Use it in a flow
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: my-whatsapp-cloud
namespace: tenant-acme
spec:
classRef: {name: whatsapp-cloud}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: whatsapp-message-received-example
namespace: tenant-acme
spec:
displayName: "A WhatsApp message arrives"
triggers:
- id: start
ref: {name: whatsapp-message-received}
connectorRef: {name: my-whatsapp-cloud}
next: [notify-in-app]
nodes:
- id: notify-in-app
stepRef: {name: notify-in-app}
config:
body: 'Total: {total}'
title: New invoice from {supplier}
to: admins