# Handle Vapi voice agent tool calls and call logging with Google Sheets and Gmail

> Quick overview This workflow provides a backend webhook for Vapi voice agents, handling mid-call tool calls via Google Calendar and Google Sheets, then logging end-of-call details to Google Sheets and sending follow-up alerts through Gmail when keywords are detected. How it works 1. Receives a POST request from Vapi through a single webhook for both tool calls and end-of-call reports. 2. Normalizes the incoming payload to extract the event type, tool call details, caller number, call ID, transcript, summary, and call metadata. 3. For mid-call tool requests, routes by function name to either check Google Calendar availability, look up a customer in Google Sheets, append a request to Google Sheets, or return a safe response for unknown functions. 4. Formats the selected tool result into Vapi’s required { results: [{ toolCallId, result }] } response and returns it immediately to the caller. 5. For end-of-call reports, extracts a call record, scans the transcript and summary for configured

- **Domain**: `n8n-workflow-20085.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/20085
- Page (HTML): https://agenstry.com/agents/n8n-workflow-20085.n8n.io
- Documentation: https://n8n.io/workflows/20085
