Overview
WhatsApp Configuration allows your AI agent to automatically send WhatsApp templates or campaigns to customers either during the call (in-call) or after the call ends (post-call). This enables automated follow-ups, OTP delivery, booking confirmations, and more.You must connect to a WhatsApp provider before configuring WhatsApp functions.
Prerequisites
Before setting up WhatsApp configuration:-
Connect WhatsApp Provider - Go to Integrations and connect one of:
- WhatsApp (Facebook)
- Heltar
- AiSensy (Basic or Pro plan)
- Create Templates - Set up approved WhatsApp message templates in your provider dashboard
- Define Variables - If using post-call functions, configure post-call variables to extract data from conversations
Function Types
- During the Call (In-Call)
- After the Call (Post-Call)
Purpose: Send WhatsApp messages while the conversation is activeUse Cases:
- Send OTP for verification
- Share booking links
- Deliver payment URLs
- Send documents/catalogs
Configuration
1
Navigate to WhatsApp Configuration
In your agent configuration, find the WhatsApp Configuration section
2
Click Add Function
Click the ”+ Add” button
3
Select Function Type
Choose when to send:
- During the Call (in-call) - While conversation is active
- After the Call (post-call) - When call ends
4
Name Your Function
Enter a unique name using lowercase snake_caseExample:
send_otp, booking_confirmation, followup_message5
Select Provider
If you have multiple WhatsApp providers, choose which one to use
6
Choose Template or Campaign
For WhatsApp/Heltar: Select from your approved templatesFor AiSensy Basic: Enter campaign name and add variables manuallyFor AiSensy Pro: Select from your campaigns
7
Map Variables
Map template placeholders to data sources:
- Call Metadata - From prompt variables
- Post-Call Variables - AI-extracted data (post-call only)
8
Define Trigger
For In-Call: Describe when AI should send the messageFor Post-Call: Set conditions based on variables
9
Save
Click “Save” to activate the function
Provider-Specific Configuration
WhatsApp (Facebook)
WhatsApp (Facebook)
Templates: Uses officially approved WhatsApp Business API templatesSetup:
- Select template from dropdown
- View template preview
- Map variables to data sources
Heltar
Heltar
Templates: Uses Heltar platform templatesSetup:
- Select template from dropdown
- View template preview
- Map variables to data sources
AiSensy Basic
AiSensy Basic
Campaigns: Manual campaign configurationSetup:
- Enter campaign name
- Manually add variables (
{{1}},{{2}}, etc.) - Map each variable to data source
AiSensy Pro
AiSensy Pro
Campaigns: Full campaign managementSetup:
- Select campaign from dropdown
- View template preview
- Auto-detected variables appear
- Map variables to data sources
Variable Mapping
Map template placeholders to dynamic values:Data Sources
- Call Metadata
- Post-Call Variables
Purpose: Data from prompt variables or call setupAvailable Fields:
- Custom metadata fields
- Any
{{variable}}in your system prompt
In-Call Functions
Send messages during active conversations.When to Use
OTP Delivery
OTP Delivery
Scenario: User needs verification codeConfiguration:
Booking Link
Booking Link
Scenario: Share booking URL during callConfiguration:
Payment Link
Payment Link
Scenario: Send payment URLConfiguration:
Trigger Description Best Practices
Good Examples:Post-Call Functions
Send messages after the call ends based on conditions.Conditional Execution
Post-call functions use conditions to determine when to send: Simple Condition:Use Cases
Appointment Confirmation
Appointment Confirmation
Scenario: Customer booked an appointmentConfiguration:
Order Summary
Order Summary
Scenario: Customer placed an orderConfiguration:
Follow-Up Message
Follow-Up Message
Scenario: Customer interested but didn’t convertConfiguration:
Feedback Request
Feedback Request
Scenario: Call completed successfullyConfiguration:
Best Practices
Use Approved Templates
Use Approved Templates
Ensure all templates are approved by WhatsApp before using them in production.Why: Unapproved templates will fail to sendCheck: Template status in your provider dashboard
Map All Variables
Map All Variables
Every placeholder in your template must be mapped to a data source.System validates:
- All variables have a source
- All variables have a selected field
Test variable Extraction
Test variable Extraction
Before going live:
- Use Test Call feature
- Trigger the WhatsApp function
- Check that correct values are extracted
- Verify message is sent with right data
Keep Messages Concise
Keep Messages Concise
WhatsApp templates have character limits and formatting rules.Tips:
- Keep messages under 1024 characters
- Use clear, simple language
- Include only essential information
Use Meaningful Names
Use Meaningful Names
Function names should clearly describe their purpose.Good:
send_otp, booking_confirmation, order_summaryBad: func1, wa_msg, testSet Specific Conditions
Set Specific Conditions
For post-call functions, make conditions as specific as needed.Example:
Examples by Industry
E-commerce
Order Confirmation (Post-Call):Healthcare
Appointment Reminder (Post-Call):Real Estate
Property Details (In-Call):Financial Services
Loan Application Status (Post-Call):Troubleshooting
Function not triggering
Function not triggering
For In-Call:
- Description too vague
- AI doesn’t recognize trigger
- Make description more specific
- Test with explicit phrases
- Add more trigger keywords
- Conditions not met
- Variables not extracted
- Check condition values
- Verify variables were extracted in call log
- Review post-call analysis
Message not sending
Message not sending
Possible Causes:
- Template not approved
- Provider integration disconnected
- Invalid customer phone number
- Variables not mapped correctly
- Check template status in provider dashboard
- Verify provider connection in Integrations
- Ensure phone number is valid WhatsApp number
- Review variable mappings
Wrong data in message
Wrong data in message
Issue: Message sends but with incorrect valuesCauses:
- Wrong variable mapping
- Variable not extracted correctly
- Field name typo
- Review variable mappings
- Check post-call analysis for extracted values
- Verify field names match exactly
Can't save function
Can't save function
Common Issues:
- Function name already exists
- Invalid name format (use snake_case)
- Unmapped variables
- Missing required fields
- Use unique name
- Follow snake_case format (e.g.,
send_otp) - Map all template variables
- Fill all required fields
AiSensy functions not working
AiSensy functions not working
For Basic Plan:
- Ensure campaign name is correct
- Add all variables manually
- Map each variable
- Select campaign from dropdown
- Campaign must be active
- Template must have correct variables
Advanced Tips
Dynamic Content
Use call metadata to personalize messages:Multi-Language Support
Create separate functions for each language:Conditional Follow-Ups
Chain post-call functions with different conditions:Getting Help
Test Your Functions
Use Test Call to verify WhatsApp functions send correctly with proper data
Contact Support
Our team can help optimize your WhatsApp automation strategy