Quick overview
This workflow receives Twilio call recording callbacks, transcribes the audio with Groq Whisper, uses Google Gemini/Groq LLMs to extract structured donation details, and appends the results (with transcript and review flag) to Google Sheets.
How it works
- Receives a Twilio Recording Status Callback webhook and immediately responds with TwiML (
<Response/>).
- Captures call metadata (CallSid, caller number, recording URL/SID, and duration) and continues only if the recording exists and is at least 2 seconds long.
- Waits briefly for Twilio to finalize the media, then downloads the recording MP3 using Twilio HTTP Basic Auth.
- Sends the audio file to Groq’s Whisper transcription endpoint to generate a text transcript.
- Uses a LangChain prompt with Google Gemini and Groq chat models to extract donation amount, fee (if mentioned), beneficiary name, currency, a needs-review flag, and a short summary from the transcript.
- Parses the model output as JSON and falls back to an error summary with
needs_review=yes if parsing fails.
- Checks Google Sheets for an existing row matching the CallSid/RecordingUrl and, if not found, appends a new row with the extracted fields, transcript, and call details.
Setup
- Create and connect credentials for Google Sheets OAuth2, a Google Gemini (PaLM) API key, and Groq API access (used for both chat and Whisper transcription).
- Add Twilio HTTP Basic Auth credentials (Account SID and Auth Token) so the workflow can download the recording media URL.
- Replace
spreadsheet_id and select the target sheet/tab in both Google Sheets steps, ensuring the columns used in the append mapping exist.
- Copy the n8n webhook URL and set it as the Twilio Recording Status Callback (or RecordingStatusCallback) for your Twilio voice setup so Twilio posts CallSid/RecordingUrl fields to the workflow.