https://discord.gg/botpress logo
WhatsApp Broadcast
# 🤝help
n
1. I have already set up the message template and followed the instructions to set up the card but how do I actually send out the broadcast (message template)? 2. This is supposed to be a broadcast; it should allow me to send to multiple numbers at the same time but why it seems like I can only send this to one person at a time since I need to enter the user phone number? https://cdn.discordapp.com/attachments/1370423197199110165/1370423197396111430/Screenshot_2025-05-09_at_23.29.18.png?ex=681f718f&is=681e200f&hm=8ca2a98fa98adff7d0827406bbe987da8ff7975a8cdf2239ef9b2b6e671b80cb&
l
you will need an external service to achieve this, your wont be able to loop this vai botpress
e
Hi, I have not worked with whatsapp integration to open conversations at the moment, but trying to be of some help regarding what I see.
- Step 1: Activate conversation from a code card Link: https://botpress.com/docs/integrations/integration-guides/whatsapp/whatsapp-start-proactively According to the official documentation, you can use: actions.whatsapp.startConversation({ userPhone: '+1 123 456 7890', templateName: 'test_message', templateLanguage: 'en', templateVariablesJson: JSON.stringify(['First value', 'Second value']) }); ⚠️ Note If it only works for one user at a time, you will need to wrap it inside a loop to apply the action to multiple users.
- Step 2: Get user information from the API Use the Botpress API to get the list of users: Link: https://botpress.com/docs/api-reference/runtime-api/openapi/listUsers
The response will include the tags for each user, where for WhatsApp you will usually have the phone number stored. - Step 3: Go through the users and activate conversations With the list of users, on your code card you can do: -> this code was made in chatGpt, so it was not tested, it's just for demonstration purposes.
Finally, to take into account: 1. All this is only a possible way to deal with the inconvenience of being able to open only one conversation, so at no time is it confirmed that it can be useful. 2. Keep in mind that the meta itself has anti spam policies and additional charges when trying to open a conversation after 24 hours, so it is good to consider all this before opening massive conversations because you run the risk of suspending the number. 3. There is a limit to how long a program can be in the same node, if I'm not wrong it is 30 seconds. so if the loop takes more than that, you could deal with it, leaving it in an asynchronous method and keep it running even when the program ends, or split it in several sections, if you have many users.
I hope it can be of help, P.S., everything was translated, so you run the risk of not understanding it well.
🫡
l
@echoing-notebook-80704 - This is indeed great. The only challenge is that Botpress has a timeout of 60 seconds per operation. If the list of users can be covered within that timeline of 60 seconds, the messages will be sent (although Step 3. has to be edited) Additionally, sending broadcast message without intervals will lead to spam rate limit being hit and META blocking further messages being sent
e
yes, there are many things to consider, but I hope my little bit helped.👋
n
There's a ton of ways to do this. I think the fastest/least-coding way would be to get a table of numbers you want to send it. Then put a subworkflow card onto an Autonomous node, set a variable for the phone number you want to intake to the subworkflow, and then give the autonomous node a Table-findrows card and instructions to send the message to everyone in the list 👍🏽 Botpress is like a toolkit. There's 1000 ways to skin the cat, so you have to find the right balance for you between autonomous nodes and non-autonomous nodes. To be frank, your use case doesn't need nodes or botpress at all. It's simply a for loop through a list of numbers, calling the Whatsapp API with different numbers attached
Something to consider: If whatsapp API doesn't allow sending a list of numbers, that means they do not want anyone mass-messaging people via the API, means they probably will also rate limit you
n
Wow! It is more complicated than I imagined 🥲
l
My platform can solve this for you
n
tell me about your platform? DM me!
2 Views