8000 retell/outbound-lead-calling: outbound lead calling with Retell, verified call events through Hookdeck and a live topology pane by leggetter · Pull Request #48 · hookdeck/hookdeck-demos · GitHub
[go: up one dir, main page]

Skip to content

retell/outbound-lead-calling: outbound lead calling with Retell, verified call events through Hookdeck and a live topology pane - #48

Merged
leggetter merged 22 commits into
mainfrom
feat/retell-outbound-lead-calling
Nov 18, 2026
Merged

leggetter merged 22 commits into
mainfrom
feat/retell-outbound-lead-calling

Conversation

@leggetter
@leggetter leggetter commented Nov 16, 2026 •
Copy link
Copy Markdown
Collaborator

Adds retell/outbound-lead-calling: a lead form starts a Retell voice call, and Retell's call events come back through a Hookdeck RETELL source into an app that tracks each lead, with a live topology view of both directions.

The demo

  • Setup (npm run setup): the Hookdeck RETELL source (verified with the Retell webhook key), CLI destination and connection (dedup on body.event + body.call.call_id, 10 minutes; retry from 30 s), plus a Retell LLM and agent with webhook_url set to the source URL, the three webhook_events and post-call analysis fields. npm run probe proves verification is on; npm run simulate sends signed events (--twice, --bad-signature).
  • The page: a lead form that starts a browser call with RetellClient (retell-client-js-sdk 3.0.4) and a Retell public key, so the API key stays on the server. Sam, Acme Realty's caller, calls the lead named in the enquiry form and you answer as the lead; the lead moves through Calling, In call, Call ended and Analyzed as call_started, call_ended and call_analyzed arrive. A no-answer, busy or voicemail call_ended schedules the next attempt (up to 3, with a countdown); "Lead does not answer" sends a signed no-answer event through the source without placing a call. Explanations sit behind ⓘ dialogs and hover tips. A failure panel fails the next N deliveries or delays them.
  • Open house theme (default; System, Light and Dark remain): restyles main only, never the Data flow pane, via _shared/theme.
  • Optional paths: an outbound phone call via POST /v2/create-phone-call (needs a purchased Retell number; the app only dials the number in .env), and live-call injection through a custom function plus update-live-call (off by default).
  • Live topology in the bottom pane, open by default: the outbound start-call edge from the app to Retell, and the event path Retell → Event Gateway (verify, dedup, retry) → hookdeck listen → the app. Tabs play four scripted scenes (call lifecycle, duplicate dropped, bad signature, app down then retry). Clicking a packet shows its attempts and a View in Hookdeck link.
  • Captures: MP4s of the four scenes, landscape and square, in scenes/captures/.

Shared pieces

_shared/scenes and _shared/topology-pane are byte-identical to #47's head (a0a7476), including the capture change that reads scene ids and brand from the bundle. _shared/flow-drawer comes in from #44 for the server-side state.

Live-run facts

A real web call on 2026-11-16 sent call_started, then call_ended and call_analyzed at the same instant (a short call); all three were verified: true on the source. A bad signature gets HTTP 200 and a VERIFICATION_FAILED request record with no event. A duplicate is dropped by the dedup rule; a 503 from the app is retried 30 s later and succeeds. Phone calls are untested: the account has no Retell 8000 number.

Merging

Checks

node scripts/sync-shared.mjs --check and tsc --noEmit pass. The 32 tests (lead events, the retry ladder, theme copy, scene parity, the pane) pass at the branch head.

Update 2026-11-18: Open house theme, roles framing, the retry ladder and ⓘ dialogs (e56314f..e61d488). Tutorial impact (hookdeck/website#1010): Step 7's call_ended branch gains one ...planRetry(...) line; the duplicate check now also compares the call id.

Review fixes: (33f332b..b67d9e0) loopback bind (HOST), capped form fields and a minimum gap between phone dials, guarded async handlers and a JSON error handler, a stale-call guard (late events for an earlier attempt are ignored), the duplicate marker recorded after the update, an idempotency key per attempt, the ladder restored when a retry fails to start, browser reports no longer move a lead backwards, Retell's never-connected disconnection_reason values, and unknown_lead stays a 200 with a log line. Tutorial impact: Step 7's handler is now async with try/catch; the switch cases are unchanged.

Merge readiness (a40f7bf): root README shared rows; HOST, PHONE_DIAL_MIN_INTERVAL_SECONDS, LEADS_FILE and HOOKDECK_CLI in .env.example; the latest pane and feed polling is synced from _shared; the theme test reads the demo's own theme.js so npm test passes in a standalone copy.

🤖 Generated with Claude Code

Posted by an AI agent with human oversight.

leggetter and others added 12 commits November 12, 2026 17:12
A lead form starts an outbound Retell call with dynamic variables. The call_started, call_ended and call_analyzed events return through a Hookdeck RETELL source (signature verification, deduplication, retries) to update the lead and store the analysis. Optional run-in-background custom function with update-live-call.

Not yet tested against a real Retell account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t shared Hookdeck helpers, add probe and in-page Start call

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…key, phone call optional

Replaces the deprecated RetellWebClient and server-minted token with
retell-client-js-sdk 3.0.4 RetellClient.c
8000
reateWebCall and RETELL_PUBLIC_KEY.
The browser call is the main path; the phone call is optional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ook-badged key, when it differs from RETELL_API_KEY

Retell signs every webhook with the one API key that has the webhook badge. Checked
against real webhooks: they match RETELL_SECRET_KEY, not RETELL_API_KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom the ElevenLabs branch (ccae480 / 58e7bbb), byte-identical; list them for retell/outbound-lead-calling

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ith an outbound start-call edge) and four scripted scenes

Scenes: call lifecycle, duplicate dropped, bad signature, app down then retry,
desktop and phone layouts, prefixed retell-* for the website's voice-ai set.
The app records its deliveries and outbound calls for the pane (/api/deliveries,
/api/outbound) and serves /api/flow from Event Gateway's API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…T_KEY when set, as the source verifies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
< 8000 span class="Skeleton d-inline-block" style="width:12px; height:12px;">
…(landscape and square, light)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a0a7476); retell: brand Retell

npm run capture now works for the retell-* scenes without a patched copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er README)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leggetter and others added 4 commits November 17, 2026 21:54
…e3f4e), byte-identical; retell/outbound-lead-calling uses it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…up (call_ended schedules the next attempt, three attempts), a signed no-answer simulation, and per-call idempotency

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ialogs and hover tips), Sam and the lead on screen, Open house theme, retry ladder on the lead card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he call button only shows a problem or the next ring

The Sam → lead pill already says the call is ready, so the tag no longer repeats it, and during a retry it shows only the time to the next ring (the lead card shows the attempt), which stops the row wrapping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leggetter and others added 6 commits November 18, 2026 11:16
… stale calls, record the timeline marker last, classify Retell's never-connected disconnection reasons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Y_DELAY_SECONDS falls back to 120, retry.ts says production needs a scheduler

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce out phone dials, catch handler errors, restore the ladder when a retry fails to start

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… when verified, keep the Hookdeck API key off the CLI command line and out of errors

Cherry-picked from 5fe85ba (feat/vapi-agency-routing) so the shared files stay byte-identical across the demo branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, HOST, dial interval, LEADS_FILE and HOOKDECK_CLI in .env.example, the latest pane and feed polling from _shared, theme test reads the demo's own theme.js

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lead-calling

# Conflicts:
#	README.md
#	_shared/manifest.json
@leggetter
leggetter marked this pull request as ready for review November 18, 2026 12:28
@leggetter
leggetter merged commit 8cedade into main Nov 18, 2026
9 checks passed
@leggetter
leggetter deleted the feat/retell-outbound-lead-calling branch November 18, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0