// build guide

Build an AI Voice Agent That Takes Action

An AI receptionist on Retell that captures real appointment requests and pings your Slack through n8n.

03 / 11 Retell AI n8n Claude Code June 2026 ▶ Watch the video

What you’ll build

A working AI voice receptionist for a home services contractor. Caller dials your number, AI agent named Alex takes their name and reason for calling, and your phone gets a Slack ping with the lead info — before the caller even hangs up. ~$2/mo to operate. Whole thing built in about 90 minutes, mostly by Claude Code.

What you’ll need

  • Claude Code installed (Sonnet or Opus, doesn’t matter)
  • Retell AI account (free dev tier) — for the voice layer
  • A Slack workspace where you can create an app
  • ngrok free account — for the public tunnel
  • Node.js installed (for npx n8n)
  • Homebrew (Mac) — for brew install ngrok

Step 1: Get your 4 API keys

This is the only manual work in the whole build. Five minutes of clicking.

  1. Slack webhook URL — go to api.slack.com/apps, create a new app called “Voice Agent Demo”, enable Incoming Webhooks, bind it to a new channel like #voice-agent-demo, copy the URL.
  2. Retell API key — Retell dashboard → API Keys → copy.
  3. ngrok auth token — free signup at ngrok.com → Your Authtoken → copy.
  4. n8n API key — you’ll generate this in Step 3 after booting n8n.

Drop the three you have into a .env file:

SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
RETELL_API_KEY=...
NGROK_AUTHTOKEN=...
N8N_API_KEY=  # filled in Step 3

Step 2: Set up ngrok

brew install ngrok
ngrok config add-authtoken <your-token>

Don’t start the tunnel yet — wait until n8n is up.

Step 3: Boot n8n and grab the API key

npx n8n

That’s it. No Docker, no install, no signup. Boots on http://localhost:5678. Create the owner account, go to Settings → API → generate a key → paste it into .env as N8N_API_KEY.

Step 4: Open the ngrok tunnel

In a new terminal:

ngrok http 5678

Copy the public URL it gives you (looks like https://spearhead-stage-available.ngrok-free.dev). This is what Retell will hit. Free tier URLs rotate on restart — fine for dev, swap for a real host later.

Step 5: Tell Claude Code to build the n8n workflow via API

Open Claude Code in a fresh project folder. Drop your .env in. Then prompt:

Write a Node script that POSTs to the n8n REST API at http://localhost:5678 using my N8N_API_KEY from .env. Create a workflow with three nodes: (1) a Webhook trigger node, (2) an HTTP Request node that POSTs a Slack message to SLACK_WEBHOOK_URL with the caller’s name and reason, (3) a Respond-to-Webhook node that returns {ok: true, confirmation: "Logged for <name>"} back to Retell.

Two things Claude Code needs to know — the bugs that bite every n8n beginner:

  • In n8n, string fields with {{ }} templates only evaluate if you prefix the whole string with =. So ={ "text": "{{ $json.body.args.name }}" }, not { "text": "{{ $json.body.args.name }}" }.
  • Retell sends tool calls with args nested at body.args.name and body.args.reason. body.name is the tool name, not the caller’s name. Read the raw payload before writing expressions.

Save the script as scripts/create_workflow.js. Run it once.

Step 6: Tell Claude Code to build the Retell agent via API

Same Claude Code session, next prompt:

Write a Node script that hits Retell’s API to create (1) a response engine LLM with a system prompt that strictly scripts a 6-step home-services call intake — disclose AI, get name, get reason, fire log_and_notify tool pointing at my ngrok URL /webhook/<path>, deliver the closing line, call end_call to hang up. Register both log_and_notify and end_call as tools. (2) An agent bound to that LLM with voice 11labs-Adrian and ambient sound call-center. Use my RETELL_API_KEY from .env.

The system prompt that worked (paste this into Claude Code so it doesn’t reinvent it):

You are Alex, an AI voice agent answering calls for BlueRiver Home Services
(HVAC, plumbing, electrical).

## Step 1: After greeting, immediately say:
"Just so you know, I'm an AI voice agent. Our team is helping another customer
right now, but I can take down your information and notify them immediately.
Can I get your name?"

## Step 2: Wait for name. No follow-ups. No commenting.

## Step 3: Say exactly: "Thanks, [name]. What do you need help with today?"

## Step 4: Listen to reason. ONE sentence is enough.
Do NOT ask probing follow-ups. You are an intake agent, not a technician.

## Step 5: Call log_and_notify with only `name` and `reason`.

## Step 6: Say: "Got it, [name]. I've alerted the team, someone will be in touch
shortly. Have a great day." Then call end_call.

# Hard rules
- Max 2 questions: name, then reason.
- Never read URLs, IDs, or technical details out loud.
- Never keep the call going past Step 6.

Begin message (the first thing the caller hears — handles AI disclosure cleanly):

Hi, this is Alex with BlueRiver Home Services. Just so you know, I'm an AI voice
agent. Our team is helping another customer right now, but I can take down your
information and notify them right away. Can I get your name?

Save as scripts/create_retell_agent.js. Run it.

Step 7: Test the agent through the Retell dashboard

Retell has a “Test Call” button. Click it, talk into your browser mic. The agent should answer, take your name and reason, fire the Slack ping, and hang up.

If it stays on the line after the closing message — the end_call tool isn’t registered or the prompt isn’t explicit. Re-prompt Claude Code to fix and re-run.

If it over-asks probing questions (“can you tell me more about the issue?”) — the prompt is too loose. Make Step 4 even more strict.

Step 8: Bind a phone number and call from your cell

In the Retell dashboard: Phone Numbers → buy or import a number → bind it to your agent. Call from your cell.

Slack should ping within 2 seconds of you finishing your reason. Often before the call ends. That’s the whole point.

Compliance notes (read before selling this)

  • AI disclosure is in the begin message — required by FTC + several state laws.
  • Call recording — if you’re in CA, FL, IL, MD, MA, MT, NH, PA, or WA (two-party consent), add “This call may be recorded for quality” to the begin message.
  • TCPA — inbound is safe. If you ever flip this to outbound cold-calling, TCPA gets serious. Different build.
  • HIPAA — if your client is healthcare, no PHI capture without a BAA. Keep intake fields shallow.

Not legal advice — verify in your state.

Productize it

Same script + different system prompt = HVAC, med spa, dental, restaurant, real estate, whatever. Deploy time per new client is about 3 minutes — paste a new Slack webhook URL, bind a new phone number, re-run the two scripts.

The recurring cost for each client is ~$2/mo + $0.07/min of call time. Sell it as a $1,500/mo retainer. Three home services contractors and you’ve replaced your freelance income.

Resources

Some links above are referral links — they cost you nothing and support the free guides.

Good luck and happy building