See llms.txt for all machine-readable content.

Back to Templates

Route AI voice call webhooks to WhatsApp and Google Sheets with OpenAI

Quick overview

Your voice agent ends a call and fires a webhook. I built this to read each call, pick out the urgent ones from the model’s own fields, and send those to the owner’s WhatsApp. Calls it reads, and calls with no usable text, are logged to Google Sheets.

How it works

  1. Receives a POST webhook when a voice call ends, containing the call metadata plus an optional transcript and summary.
  2. Normalizes the incoming payload into consistent fields (call ID, end reason, transcript/summary text, and caller phone) and checks whether the call has usable text based on known failure end reasons.
  3. If the call is unprocessable (for example no transcript/summary or a failure end reason), creates an “unprocessable” record and appends it to the Google Sheets “Call Log” tab.
  4. If the call has usable text, sends the transcript/summary to OpenAI to extract structured facts such as caller name/phone, intent, sentiment, urgency, summary, requested action, and any follow-up date. If that OpenAI call fails, for example on a bad key or a rate limit, the run stops here and the call is not logged, so check the n8n executions list for failed runs.
  5. Decides whether the call is urgent using the extracted urgency/sentiment plus keyword matching against your configured urgent keyword list.
  6. Appends the call to Google Sheets as either an urgent or routine record, and optionally sends a WhatsApp message to the business owner with the urgent call details. That alert is a plain WhatsApp text, which WhatsApp only delivers if the owner has messaged your business number in the last 24 hours. For alerts at any hour, switch the node to an approved message template.

Setup

  1. Copy the webhook URL from the "Voice Call Ended" trigger and set your voice agent platform to POST its end-of-call payload to that URL. The webhook ships without authentication, so keep the URL private, or add a Header Auth credential to the trigger if your platform can send a custom header. Normalise Call Payload reads Vapi's end-of-call report, where the fields sit under message, and payloads that post their fields at the top level. In Vapi, set Server Messages to end-of-call-report only. I tested it with a Vapi-shaped sample only, so other platforms may need their fields mapped in that node.
  2. Add an OpenAI credential for the extraction model and select the model you want to use.
  3. Add a WhatsApp Business Cloud credential, set your WhatsApp Business phone number ID, and fill in the business owner’s WhatsApp number in the handoff settings.
  4. Add a Google Sheets credential and replace the placeholder spreadsheet IDs and sheet/tab names for “Call Log”, “Urgent calls”, and “Routine calls” (or swap these logging steps for your CRM nodes).
  5. Review and customize the urgent keyword list and the WhatsApp auto-send switch in the handoff settings before activating the workflow.

Requirements

  • n8n 1.123.0 or later, because the IF node in the file is a version older releases do not have.
  • An OpenAI API key, a WhatsApp Business Cloud number, and a Google account for Sheets.

Additional info

Screenshots, the running cost and the parts that break are on my write-up at https://fractionalhq.uk/use-cases/voice-call-whatsapp-crm-handoff

If you would rather not set it up yourself, I can set it up for you on your own n8n account for $29. Tell me what you use at https://fractionalhq.uk/brief and I will reply with what I need from you before any work starts.

This workflow is included in my separate $10 bundle of nine n8n templates. See the full list of included workflows at checkout: https://buy.stripe.com/3cI8wIfcfdaO22C6It4c81a