Understanding the Limitation
When using Agentforce with WhatsApp, it’s essential to understand that the WABA API has limitations on how messages are sent. The API is designed to send one message per user utterance, which means that Agentforce can only send one message at a time.
Why the Current Approach Doesn’t Work
A community member tried to create a Flow and loop the list calling the “Send Message” action, but this approach doesn’t work with the WhatsApp channel. This is because the WABA API doesn’t support sending multiple messages as separate user utterances.
The root cause of this issue is the limitation of the WABA API, which is designed to send one message per user utterance.
Alternative Solutions
Although it’s not possible to send multiple separate messages using Agentforce and WhatsApp, there are alternative solutions that can be explored. For example, using a different messaging channel that supports multiple messages or using a custom solution that can handle multiple messages.
Code Example
ApexClass.cls
public class SendMessage { public List<String> messages { get; set; } public SendMessage() { messages = new List<String>(); } public void sendMessage() { // Loop through the list and send each message for (String message : messages) { // Use Agentforce to send the message // Note: This will only send one message at a time } }}
Checklist
Before Implementing an Alternative Solution
- Review the WABA API documentation to understand the limitations
- Explore alternative messaging channels that support multiple messages
- Consider using a custom solution to handle multiple messages
- Test the alternative solution to ensure it meets the requirements
- Document the solution and provide training to the team
Frequently Asked Questions
Can I use a different messaging channel to send multiple messages?
Yes, you can explore alternative messaging channels that support multiple messages.
Can I use a custom solution to handle multiple messages?
Yes, you can consider using a custom solution to handle multiple messages.
How do I test the alternative solution?
You can test the alternative solution by sending multiple messages and verifying that they are delivered correctly.
What are the limitations of the WABA API?
The WABA API has limitations on how messages are sent, including sending one message per user utterance.
Need help shipping this in production?
Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.