BotSailor Webhook Workflows can receive data from an external source and use that data to automatically send a WhatsApp template message. In this guide, the practical example is:
You will create an approved template, create a webhook workflow, configure the Google Sheet trigger, capture a sample webhook response, map the incoming fields, save the workflow, and test it.
How to Set Up WhatsApp Webhook Workflows Using Google Sheets in BotSailor
Create a webhook workflow, connect Google Sheets, map the incoming data, and check the WhatsApp notification.
BotSailor Webhook Workflows receive data from an external source and use that data to send a WhatsApp template message automatically. In this guide, Google Sheets provides the data and Google Apps Script sends it to the workflow’s callback URL.
The example is a monthly due reminder. You will prepare an approved template, configure the Google Sheet trigger, capture a sample payload, map the customer’s phone number and template values, and check the message received on WhatsApp.
Before You Begin
- An active BotSailor account with a connected WhatsApp number.
- An approved WhatsApp message template for your notification.
- A Google Sheet and permission to use Google Apps Script.
- A Phone Number column, plus columns for the template values such as customer name and due amount.
- A WhatsApp-enabled test phone number you can use to verify the message.
Walkthrough example
What Is a Webhook Workflow?
A webhook workflow allows an external application to send data to BotSailor when an event occurs. BotSailor receives the incoming payload through a unique callback URL. You map the required fields, and the workflow uses those values in the selected WhatsApp template.
How This Example Workflow Works
- A row is inserted or edited in Google Sheets according to the configured script’s trigger behavior.
- Google Apps Script sends the row data to the workflow’s Webhook Callback URL.
- BotSailor captures the incoming webhook payload.
- The phone number and template variables are mapped to the relevant row values.
- The workflow sends the selected WhatsApp template using the mapped data.
Part 01: Create the WhatsApp Message Template
Open Message Templates
Log in to BotSailor, select your WhatsApp account, and go to Automation → Message Templates.
Create a new message template for the notification you want to automate.
Configure the Template
Enter a template name and choose the required locale and template category. Write the message body and add variables for the values that will come from the webhook data.
For a due-payment reminder, prepare the customer-name and due-amount values used in your message.
Save, Sync, and Confirm Approval
Save the template, then sync its status with WhatsApp. Use the template in your webhook workflow only after it is approved.
Part 02: Create the Webhook Workflow in BotSailor
Open Webhook Workflows
From the selected WhatsApp account, go to Automation → Webhook Workflows. Click Create to start a new workflow.
Define the Workflow
Enter a descriptive workflow name. Select the approved WhatsApp message template prepared in Part 01, then review its preview to confirm that you selected the correct message.
Locate the Webhook Callback URL
In Configure Webhook Data, locate the unique Webhook Callback URL. Google Apps Script will call this endpoint when the configured sheet event occurs.
The script provided by Google Sheet Instruction already includes the workflow-specific endpoint. Use the script generated for this workflow.
Part 03: Configure the Google Sheet Trigger
Prepare the Google Sheet
Make sure the sheet contains a column named Phone Number. Add separate columns for the template values, such as customer name and due amount. Keep the headers clear so the mapping step is easier.
Open Google Sheet Trigger Instruction
In the BotSailor workflow, click Google Sheet Instruction. Copy the Apps Script code provided for this workflow.
Add the Script in Google Sheets
Open the Google Sheet and go to Extensions → Apps Script. In the Apps Script project for this setup, replace the default function with the code copied from BotSailor, then save the project.
Create the Apps Script Trigger
Open Triggers in the Apps Script editor and click Add Trigger. Use the following settings, then save the trigger:
Complete Google Authorization
Select the Google account that owns or can edit the sheet. Google may ask you to authorize the Apps Script project when you save the trigger for the first time.
Google Authorization Notice
For that project, open Advanced if needed and select the option to continue. Review the permissions and click Allow if they match the script’s required actions.
Part 04: Capture the Webhook Response
Start Capturing a Real-Time Response
Return to the BotSailor workflow and click Capture Webhook Response. BotSailor will wait for a sample event so it can identify the incoming data structure.
Trigger a Sample Sheet Event
Switch to Google Sheets and insert or edit a sample row according to the script’s configured behavior. Include a valid test phone number and values for every template variable. The Apps Script trigger sends the row data to BotSailor.
Review the Incoming Raw Data
After the sample event arrives, review the Raw Data panel. Check the row number, row data, and event type, such as INSERT_ROW or EDIT. Use this captured structure when mapping the template.
Part 05: Map the Webhook Data to the WhatsApp Template
Map the Phone Number
In Webhook Response Mapping, select the incoming Google Sheet value that represents the Phone Number column. This mapping determines which WhatsApp number receives the message.
Map the Template Variables
For every variable in your approved template, select the matching value from the captured webhook payload. Map the customer-name value to USER-NAME and the due-amount value to DUE when those are the variables used by your template.
Use a formatter only when a value needs formatting before it is inserted into the template.
Match the captured field paths
rowData (rowData > 1). The updated mapping illustration also shows a nested sample path, billing_address > name; use the customer-name field actually available in your sheet payload.Configure an Optional Delay
If needed, set a delay before BotSailor sends the message after the webhook is triggered. Use 0 minutes when the message should be sent immediately.
Part 06: Save and Activate the Workflow
Save the Mapping
Click Save Workflow after completing the mappings. BotSailor displays a confirmation when the workflow data has been mapped and saved successfully.
Confirm the Workflow Status
Return to the Webhook Workflows list. Confirm that your workflow is active and verified.
The list provides processing and delivery information, including Targeted, Processed, Delivered, Opened, Failed, Skipped, and Last Called At.
Part 07: Test the Complete Automation
Add or Edit a Google Sheet Row
Enter a valid Phone Number and the values needed by the template variables. Insert a new row or edit an existing row according to the trigger behavior configured in Apps Script.
Check the WhatsApp Message
Confirm that BotSailor receives the webhook and sends the selected template to the mapped phone number. Compare the customer name and due amount in the received message with the same Google Sheet row.
Review the Workflow Report
Use Workflow Report or the workflow list to check whether the event was processed, delivered, failed, skipped, or not reached. Use Last Called At to confirm that the workflow received the latest sheet event.
Part 08: Review the End-user Notifications
Open WhatsApp on the destination phone and review the notification. The example below shows the monthly due reminder addressed to Abir, with the amount displayed as 44.00 USD. Earlier chat messages are blurred so the new notification is easy to identify.
Received WhatsApp message
Your Monthly Due is 44.00 USD.
Please Pay Your Due Amount As Soon As Possible.
Thanks.
- Check that the message arrived at the phone number from the intended sheet row.
- Confirm that the customer’s name and due amount match the expected values.
- If a value is missing or incorrect, review the captured payload, the variable mapping, and any selected formatter.
Verification: How to Know It Worked
Verify the complete workflow
Common Troubleshooting
For a video walkthrough, watch the Webhook Workflow configuration tutorial.
Key Takeaways
- Webhook Workflows are the automation feature; Google Sheets is the data source in this example.
- Capture a sample response before mapping the phone number and template variables.
- Use an approved template and verify the received WhatsApp message against the source row.
Next Steps
- Adapt the same webhook pattern for order updates, abandoned-cart recovery, COD verification, form submissions, or another system that can send webhook data.
- Create separate workflows for different message templates or business events so each workflow has clear mapping and reporting.


