The community member is trying to integrate WhatsApp audio uploads into their Typebot flow and differentiate them from regular text messages. They are using the official WhatsApp integration and uploading the audio to N8N for transcription. The main issue is how to determine if the incoming message is an audio file or regular text. One community member suggests using a File block in Typebot to get the WhatsApp audio, sending it to N8N, and then adding a "[Audio]" prefix to the transcribed text. Another community member suggests using the "Allow attachments" option in the Text input to differentiate the uploaded file variable from the text. The community members work together to find a solution, and the final answer is to use the "Allow attachments" option to differentiate audio and text messages.
Hey guys, how can I use the file block to upload a whatsapp audio? What I am trying to achieve here is this: The user sent an audio using whatsapp (I am using the official whatsapp integration in typebot) I upload this audio to N8N using a webhook. In N8N I am making the transcription of the audio. I already tested and everything is working, but now I need to find a way to differentiate the text that user sent from audio. How can I do that?
To differentiate between audio transcriptions and regular text in your Typebot flow:
When receiving an audio file Use a File block in Typebot to get the WhatsApp audio. Send it to N8N for transcription. When N8N sends the transcription back, add a prefix like "[Audio]" to the text.
For regular text messages Process them as you normally would, without any special prefix.
In your Typebot flow Check if the incoming message starts with "[Audio]". If it does, you know it's a transcription from audio. If it doesn't, it's regular text input from the user.
I can't use the file block if the user sent a text message, otherwise I will have an error. I need to understand, somehow that the message sent is an audio.
@Baptiste any chance to have the type of message from whatsapp as a environment variable? I know that they sent a type field saying it is a media or text in the json. Maybe we can add this to the environment, so I can test it on typebot.