Quick overview
This workflow provides a Gemini Live assistant for an e-commerce store by generating single-use Gemini ephemeral tokens, loading a knowledge base from a Google Drive folder, and handling tool calls to read order status, create return/exchange requests, log complaints to Google Sheets and notify the owner via Gmail
How it works
- Receives a POST webhook request to create a new Gemini Live voice session.
- Applies daily and per-IP rate limits, then lists and downloads supported knowledge files from a specified Google Drive folder and combines them into a single system prompt.
- Builds a Gemini Live session configuration (voice, model, and tool schema), signs the session with an HMAC, and requests a single-use ephemeral token from the Gemini API.
- Returns the token, model, WebSocket URL, signed session metadata, and tool-callback URL to the client via the webhook response.
- Receives tool-call webhook requests from the Gemini Live client, validates the HMAC signature and expiry, and enforces a per-session tool-call limit.
- For authorized tool calls, reads order data from Google Sheets to return order status, verifies and appends return/exchange requests to Google Sheets and emails the owner, logs complaints to Google Sheets and emails the owner, or sends owner notifications for unanswered questions.
- Responds to the tool-call request with a JSON result (or returns an error for missing info, rate limits, unknown tools, or unauthorized calls).
Setup
- Add an HTTP Header Auth credential containing your Gemini API key with header name
x-goog-api-key.
- Connect Google Drive OAuth2, Google Sheets OAuth2, and Gmail OAuth2 credentials used by the workflow.
- Update the Business Settings values, including owner email, Google Drive folder ID, Google Sheet ID, public tool URL, and a long random HMAC secret.
- Create or update the Google Sheet with tabs and columns for
Siparisler, Iadeler, and Sikayetler matching the fields the workflow reads/writes.
- Copy the production webhook URLs for
/webhook/gemini-live-token and /webhook/gemini-live-tool into your client application and restrict allowedOrigins on both webhooks to your site domain.