Automated WhatsApp Voice Message Transcription and Reply

somdn_product_page

Automatically transcribes audio messages from WhatsApp and posts the transcription back to the chat.

This workflow is designed to listen for incoming WhatsApp messages via a webhook, specifically targeting audio messages. When an audio message is received, it’s converted from base64 encoding to a binary file format compatible with transcription services. The binary audio file is then sent to an API powered by OpenAI’s Whisper model for transcription. Once the transcription is complete, the workflow automatically sends the transcribed text as a message back into the WhatsApp chat via an API (Evolution API). This automation is useful for users who want to convert voice messages into text seamlessly, saving time and making communications more accessible.

**Step-by-step Breakdown:**

1. **Webhook Trigger:** Listens for POST requests at the endpoint `seucaminho/MESSAGES_UPSERT`. When a message (particularly an audio message) is received, it triggers the workflow.

2. **Extract and Set Data:** Parses the incoming data to extract relevant details such as sender number, sender name, message content, message type, and the base64 encoded audio. These are assigned to variables for further processing.

3. **Conditional Switch:** Checks if the message is an audio message (`audioMessage`). If true, proceeds with the next steps.

4. **Convert Base64 to File:** Converts the base64 string into a binary file named `audio.mp3`, making it suitable for API transmission.

5. **Send Audio for Transcription:** Performs an HTTP POST request to the OpenAI transcription API (`https://api.groq.com/openai/v1/audio/transcriptions`), sending the audio file along with model and language parameters.

6. **Receive Transcription:** The API responds with the transcribed text.

7. **Send Transcribed Message:** Uses the Evolution API to post the transcribed text back into the original WhatsApp chat, quoting the original message if necessary.

**Use Cases:**

– Automating voice message transcription for busy professionals.

– Making voice communications accessible for hearing-impaired users.

– Saving time by turning long voice notes into readable text.

– Integrating WhatsApp with AI-based transcription for customer support.

– Creating a recording-to-text pipeline for various messaging or customer interaction scenarios.

Node Count

6 – 10 Nodes

Nodes Used

convertToFile, httpRequest, n8n-nodes-evolution-api.evolutionApi, set, switch, webhook

Reviews

There are no reviews yet.

Be the first to review “Automated WhatsApp Voice Message Transcription and Reply”

Your email address will not be published. Required fields are marked *