https://discord.gg/botpress logo
Whatsapp integration: sending a message from "afte...
# 🤝help
b
## INTRO My Whatsapp integration is working fine. Conversation starts proactively after a webhook messager arrives, and everything else is working OK. However, I'm trying to send a feedback message from the After incoming hook into the current conversation whenever a file is received. I am sending the message using axios to the API and it almost works. The feedback message is shown in the conversation log of Botpress studio ✅ but it never arrives to the Whatsapp chat ❌. ## DESCRIPTION In more detail, te scenario is as follows: - I need to collect a set of documents from the user. Asking the user to send them one by one is a bit tedious so I want them to be able to send them all at once in one message. - Whatsapp however behind the scene sends each file in a separate message. - In order to give the user some feedback while each file is received by Botpress I just want to send a message such as "_File FooBar.pdf received_" - So I created an After incoming hook that takes care of the messages with files, with the snippet shown in the attachment - In the bot console there's neither a error message nor a success message. ## IT LOOKS LIKE AN INTEGRATION ISSUE SINCE THE MESSAGE IS SHOWN IN THE CONVERSATIONS LOG BUT IT DOESN'T ARRIVE TO WHATSAPPP ## ALTERNATIVE SOLUTION If I let an antonomus node handle the files reception, it works well. It shows the feedback as the files arrive and it's a better UX than just sitting waiting without knowing if something is being done. THE PROBLEM WITH THIS APPROACH is that regadless how I tell the AI to store the information of those files in
workflow.files
(enabling it writing permission to that variable). It never gets it done. The Result is always
workflow.files=[]
. And this is a recurring issue I've been having. The AI understands the assignment and the conversation goes well until I need it to store the data somewhere. https://cdn.discordapp.com/attachments/1479130295755341920/1479130296702996654/image.png?ex=69aaeaef&is=69a9996f&hm=4faebc945020a1b5f0ff85e23526e0eb1c70439fe04392d26d7b80e43e8f1234&
l
Hello @busy-hair-61440 thank you for reaching out, before diving deeper can we test one quick thing? Instead of a workflow variable can we test with a user variable?
I bet the answer is in front of me but I just can see it. Any help is apreciated. Thanks!!
Maybe the prompt is wrong or too vague... sometimes it shiws the original filename and sometimes the filename given by botpress/whatsapp
## WORKAROUND I'm going to separate the tasks although I would have liked to make it work either only using an autonomous node or the hook, but since one of them does one of the tasks well and the other does the other, I'm going to use them both: 1. the After incoming hook extracts the files data from every IncomingEvent and stores it in either the conversation scope or the user scope 2. the autonomous node takes care of the conversation and the feedback but nothing else 3. Once the user sends FIN (END) the workflow continues to a node with a code execution card and process the data stored
l
Nice workaround!!! 🔥
n
@busy-hair-61440 hello, can I DM you🙏