Form to WhatsApp message
Publish a hosted form and send each person who submits it a WhatsApp template message from an automation.
In this guide you build an automation that publishes a web form, stores each submission, and sends the person a WhatsApp confirmation. The message is sent by the WhatsApp Business Cloud service of the Integration node.
The finished workflow:
Trigger (Form: name, phone, service)
→ Data Store (POST the submission)
→ Integration (WhatsApp Business Cloud, Send Template Message)
failure → Messaging (SMS alert to your team)Why a template
WhatsApp only lets a business send free-form text to someone who has messaged it in the last 24 hours. A person who has just filled in a web form has usually never written to you, so the first message must be a template that Meta has approved. The Integration node sends exactly what you configure: it does not switch to a template for you, so a Send Text Message outside the 24-hour window is rejected by WhatsApp.
Before you start, you need:
- A WhatsApp Business account on the Cloud API, with its access token and phone number ID.
- An approved WhatsApp message template, for example
booking_receivedwith one body variable for the person's name. See WhatsApp templates. - Optionally, a data store to keep the submissions in.
Create an automation project
Go to Projects, select New project, set Channel to Automation and create the project.
Build the form
- Open the Trigger node, go to Trigger Settings and select the Form card, or drag Form Trigger from the palette's Triggers group instead.
- Set Form name to
Book a serviceand leave Output variable asform. - Select Add field and create three fields:
| Label | Key | Type | Required |
|---|---|---|---|
| Full name | full_name | text | On |
| WhatsApp number | phone | phone | On |
| Service | service | select, with options such as repair|Repair and install|Installation | On |
- Under Public page, set the Title, Description and Success message, for example
Thanks. We will confirm on WhatsApp shortly. - Save.
Answers reach the workflow as {{state.form.full_name}}, {{state.form.phone}} and {{state.form.service}}. See Form Trigger for every field type and option.
Save the submission
Add a Data Store node after the trigger, set Action to POST, choose your store under Data Store, and map its fields to the answers under Payload, for example name to {{state.form.full_name}}. Save.
Skip this step if you do not need to keep the submissions; each run is still listed in the project's Activity tab.
Send the WhatsApp message
- Add an Integration node after the Data Store node.
- Search for WhatsApp Business Cloud and choose Send Template Message.
- If the node shows Not Connected, select Connect and save your WhatsApp access token and phone number ID.
- Select Configure Tool and fill in the input variables:
| Input variable | Value |
|---|---|
to | {{state.form.phone}} |
templateName | booking_received |
languageCode | The template's language, for example en_US |
components | The values for the template's variables (below) |
components uses the WhatsApp Cloud API format. For a template with one body variable:
[
{
"type": "body",
"parameters": [{ "type": "text", "text": "{{state.form.full_name}}" }]
}
]- Under Record conversation in, choose the chatbot project your customers talk to on WhatsApp. The message is then added to that person's conversation in the Inbox, so an agent sees it if they reply. With the default, This project, it does not appear in the Inbox, because an automation has no inbox of its own.
- Save.
Handle a failed send
The Integration node has a Failure path that is on by default, so it has success and failure handles. Connect failure to something that tells your team, for example a Messaging node that texts your support number:
WhatsApp confirmation to {{state.form.phone}} failed for {{state.form.full_name}}.Turn on Retry for short outages. See Error handling.
Test, then publish
- Save the canvas, open the trigger, and under Form URLs select Get URLs.
- Open the Test URL, submit the form with your own WhatsApp number, and check your phone.
- Publish the project and share the Production URL. The Production URL works only after you publish.
Check that it worked
- The form shows your Success message after you submit.
- Your phone receives the template with your name filled in.
- The run in the Activity tab shows each node succeeding. See Runs and logs.
- With Record conversation in set to your chatbot, the message appears in that person's Inbox conversation.
Troubleshooting
Next steps
Appointment reminder calls
Call customers the day before their appointment from a scheduled automation, and know what a Voice (IVR) project can and cannot do for outbound calls today.
Collecting data
Collect validated answers from customers in a chatbot with the Form node, save them to a data store, and choose the right tool for USSD and the web.