Extract Twilio voice donation details with Groq, Gemini, and Google Sheets
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 (``). 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.
Related Templates
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments