Quick Overview
This workflow listens for incoming WhatsApp messages and either transcribes video audio to text with Google Gemini (after converting it to MP3 via FreeConvert) or generates and sends a voice note from a /tts text command using Fish Audio.
How it works
- Triggers when a new WhatsApp message is received and extracts the sender number, message type, media URL, and text body.
- If the message contains video media, it downloads the video from WhatsApp and creates a FreeConvert job to convert it to MP3.
- It uploads the video file to FreeConvert, waits, and polls the job status until the conversion completes.
- It downloads the converted MP3, sets the audio MIME type, and transcribes the audio using Google Gemini.
- It sends the transcription text back to the original sender on WhatsApp.
- If the message text contains /tts, it calls a sub-workflow that generates speech with Fish Audio, uploads the audio to WhatsApp, and sends it back as an audio message.
Setup
- Add WhatsApp Cloud API credentials and set your phone number ID in the WhatsApp Trigger and WhatsApp send/upload steps.
- Add your FreeConvert API key and move it into credentials (the template currently uses a hard-coded Authorization header) before enabling the workflow.
- Add Google Gemini (Google PaLM) API credentials for the audio transcription step.
- Add Fish Audio API credentials and select a voice ID for the text-to-speech step.
- Send a WhatsApp message containing video media to test transcription, or send a message starting with /tts followed by text to test voice note generation.