The call dropped. Mid-interview.
A candidate had just answered the second question of a five-question phone screen. Then the connection died. On most call workflows, that's a restart: the next call starts at question one, the candidate repeats themselves, and the notes from call one are gone.
That moment is why I built this.
The code is here:
https://github.com/team-telnyx/telnyx-code-examples/tree/main/candidate-screening-call-agent
This is a candidate screening call agent. You press one button, and Telnyx calls the candidate. An AI Assistant runs the interview β five questions, one at a time. As the candidate finishes each answer, it gets scored against a role rubric and written into a durable record.
The interesting part is where that record lives.
Most call workflows keep their state inside the call. Call ends, context ends. This sample does the opposite: every candidate gets their own durable actor β a small piece of code with its own memory that stays alive on Telnyx Edge Compute. One per phone number. It holds the candidate's profile, their answer ledger, their scores, how many times the call was retried, and the full event history.
Calls become just one way to talk to that actor.
When the candidate's history lives in a durable actor instead of a call, the resume-after-drop isn't a feature you build. It falls out of the architecture.
Here's the mechanism. Every outbound call carries its own little instruction sheet β Telnyx calls these dynamic variables. Our dial payload sends two things: the five questions to ask, and the list of questions already answered. The assistant reads that and skips straight to the next unanswered question.
There's no resume flow in the code. There's no session state in the call. I just call the candidate again, and because their actor still exists, the call continues where it left off. When I demo this, it's the moment people lean in: hang up mid-call, press the same button, and the AI says "continuing where we left off" and asks question three.
Telnyx hosts the entire conversation β speech-to-text, inference, text-to-speech, turn-taking, voicemail detection. I configured it once: an Ultra voice with expressive mode, patient turn-taking so it never interrupts a candidate mid-sentence, and premium voicemail detection. If nobody picks up, the assistant leaves a short callback message and stops. It doesn't talk at a voicemail greeting for five minutes.
The outbound call goes through TeXML β Telnyx's voice layer that places and manages the call itself. The call carries the assistant's ID and those dynamic variables, and the assistant does the rest.
Every answer gets scored. The rubric has five questions, each with ideal signals β things a strong answer would contain. The scorer combines signal matches with substance: an answer needs real content to pass, a vague one routes to human review, an empty one fails.
That's deliberate. An AI phone screen that passes everything is useless β the recruiter can't trust it. In production, the same answers route through Telnyx Decision Models for AI-graded scoring with the same output shape. The rule-based scorer is the honest floor you can audit.
The recruiter sees a live transcript and a scorecard as the call happens. Average score, per-question verdicts, and a recommended next step: advance, review, or human review.
Three things, and the architecture is already shaped for them.
First, text-back. Since the actor is the candidate's identity, an inbound SMS can land on the same actor. The candidate confirms their interview by text, and the system already knows who they are and what was said.
Second, the ATS hook. Opening a screen is already an API route. When a candidate applies, the ATS fires it β the call happens with zero recruiter effort.
Third, calibrating the scoring. The rubric signals are the demo's honesty floor; Decision Models make the grading adaptive without changing the recruiter's output.
git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/candidate-screening-call-agent
npm install
cp .env.example .env # four values: API key, TeXML app, caller id, your phone
npm run dashboard
Press one button. Telnyx calls you. You are the candidate. Answer like one.
The full walkthrough video: https://youtu.be/a03KfWduNWA
The hiring screen is the demo, but the shape generalizes: an outbound call, a structured conversation, and a durable per-person actor that remembers everything between calls.
Patient intake. Lead qualification. Insurance verification. Appointment confirmation. Anywhere a call might drop, a person might need to be called twice, and their history should follow them β that's where this architecture belongs.
The phone is the channel people actually answer. Durable state is what makes it feel human.