See llms.txt for all machine-readable content.

Back to Templates

Score Retell AI calls against your rubric with Anthropic and Google Sheets

Quick overview

Scores every Retell AI call against your own rubric, line by line with quotes, and catches the moment a new agent version gets worse. Low scores, critical fails and dropped calls are emailed at once, and a Monday report suggests three prompt changes.

How it works

  1. Retell sends call_analyzed to the webhook. The X-Retell-Signature is checked (HMAC-SHA256 over the raw body and timestamp with your Retell API key), Retell gets 204 at once, and voicemail, short calls and repeats are skipped.
  2. Code measures what needs no AI: reply latency (p50 and p90), who ended the call, calls dropped by an error, the longest agent monologue and the call cost.
  3. Claude scores the call against your rubric: pass, fail or not applicable for every line, with a quoted turn as evidence, plus the top issue and one prompt fix. The score is the share of applicable lines passed, and a failed critical line (marked !) caps it at 40.
  4. Every call becomes a row in the Call QA tab. A score below alertBelow, a critical fail or a dropped call sends an email right away with the failed lines, the evidence and the recording link.
  5. Every Monday the workflow compares this week with last week per agent, and the newest agent version with the previous one over the last 14 days. A drop of regressionPoints or more is flagged as a regression.
  6. The report lists the lines that fail most, the worst calls with recordings, and three prompt changes Claude writes from the week's low scores. A summary row per agent goes to the Weekly tab so the trend stays in the sheet.

Setup

  1. Create a Google Sheet with two empty tabs: Call QA and Weekly.
  2. In Set QA settings, fill in spreadsheetUrl, emailTo, alertEmail and emailFrom, and write your rubric: one check per line, ! at the start for critical lines.
  3. Connect Google Sheets on the three Google Sheets nodes, SMTP on the two email nodes, Anthropic on both chat model nodes, and a Crypto credential whose HMAC secret is your Retell API key (the one with the webhook badge).
  4. From Run manually, execute with manualAction = score_sample_calls to score six sample calls from two agent versions, then with manualAction = weekly_report to see the regression report.
  5. In Retell, set this workflow's production webhook URL as the agent webhook (or the account webhook), then activate the workflow.

Requirements

  • A Retell AI agent and its API key with the webhook badge.
  • Google Sheets, an SMTP account and an Anthropic API key (or another chat model).
  • n8n reachable from the internet for the webhook. Built on n8n 2.21, self-hosted, no community nodes.

Customization

  • rubric holds your checks. The default one fits a booking or front desk agent; replace it with what your agent must do.
  • alertBelow (default 70), slowReplyMs (default 2000) and longTurnWords (default 80) set when a call needs a look.
  • regressionPoints (default 10) and minCallsPerVersion (default 3) set how big a drop counts and how many calls each version needs before it is compared.
  • Swap the email nodes for Slack or Teams, or move the weekly schedule to another day.

Additional info

A rubric line the AI did not answer counts as failed, so a broken AI answer never looks like a good call.

Lines that never came up in a call are left out of the score instead of counting as passed.

Rows are written as plain text (RAW), so a quote that starts with + or = never turns into a formula.

Changing the order of rubric lines changes their numbers: start a fresh Call QA tab when you rewrite the rubric.

The call transcript is sent to the chat model for scoring.