An event booth can generate hundreds of conversations in a day, but the useful context often disappears as soon as an attendee walks away.
Someone asks a detailed product question. Another person wants a demo but leaves before speaking to sales. A third enters a giveaway, then comes back later with a buying timeline. By the end of the event, the team has badge scans and scattered notes, but not a continuous record of what each person actually needed.
The event-sponsorship-agent example turns that fragmented workflow into one stateful application on Telnyx Edge Compute.
It serves a branded microsite, answers questions through browser chat and messaging, detects the attendee's language, collects qualification details, stores leads in SQLDB, routes high-intent prospects to sales by SMS, schedules follow-up, and produces an attribution report.
What runs inside the application?
The project is a TypeScript Edge function built around a SponsorAgent actor. Each attendee or browser session maps to its own actor instance, giving the conversation a durable home.
The application combines:
- Agent SDK actors for per-attendee conversation state
- Telnyx AI Inference for language detection, translation, product answers, and contextual replies
- Programmable Messaging for SMS and WhatsApp conversations
- SQLDB for lead capture and attribution data
- KV for request-rate counters
- Scheduled tasks for post-event follow-up
- Email for follow-up when that is the attendee's preferred channel
- Edge Compute for the microsite, APIs, and webhook handlers
The voice webhook is also included as an integration point for a future Call Control conversation flow. In the current sample it validates and routes the event, then logs the handoff rather than implementing a complete live voice exchange.
One attendee, one durable agent
Inbound SMS and WhatsApp messages are routed by phone number. Browser conversations are routed by session ID.
Conceptually, the handler does this:
const agent = env.SPONSOR_AGENT.idFromName(attendeeId);
return agent.handleChatMessage({ sessionId, text });
The resulting actor owns the attendee's channel, language, qualification step, collected details, giveaway status, demo request, and follow-up state.
That matters because event conversations rarely happen in one perfectly ordered exchange. An attendee might ask a product question first, request a demo ten minutes later, and only then provide their company and timeline. The agent can continue the same workflow instead of rebuilding context from every request.
The qualification flow
The agent guides an attendee through a short sequence:
- Name
- Company
- Use case
- Company size
- Implementation timeline
- Preferred follow-up channel
Each response updates the actor state and is upserted into SQLDB. The same processMessage() method also recognizes giveaway, demo-booking, and product-question intents.
For product questions, the actor calls Telnyx AI Inference through the native binding:
const response = await this.env.TELNYX.ai.openai.chat.createCompletion({
model: "moonshotai/Kimi-K2.6",
messages: [
{ role: "system", content: systemPrompt },
{ role: "user", content: question },
],
});
The sample first detects the attendee's language and stores the ISO language code in session state. Later answers and qualification prompts can then be returned in that language.
Routing a hot lead while they are still at the booth
A CRM record is useful, but timing is the interesting part of an event workflow.
When an attendee completes the qualification fields and requests a demo, the agent sends an SMS alert to the sales team immediately. The notification contains the captured context, including the company, use case, size, and timeline.
await this.env.TELNYX.messages.send({
to: salesTeamNumber,
from: eventNumber,
text: hotLeadSummary,
});
This gives a sales representative the opportunity to start a relevant conversation while the attendee is still nearby, rather than discovering the lead in a report the following week.
Scheduling follow-up without a separate queue
After qualification, the attendee can choose SMS, WhatsApp, email, or a call as the preferred follow-up channel. The actor schedules the work with the Agent SDK:
await this.schedule(delaySeconds, "sendFollowUp", {
phone,
channel,
});
When the task runs, the agent retrieves the lead from SQLDB, falls back to its durable state if necessary, asks the inference model to create a concise message, and sends or logs the result for the selected channel.
Demo deployments use a short delay so the workflow is easy to observe. A live deployment can schedule the follow-up for the next day.
Measuring more than badge scans
The GET /api/report endpoint queries SQLDB and returns:
- Total captured leads
- Total qualified leads
- Total converted or giveaway-entry leads
- Lead counts by interaction channel
- Lead counts by use case
This is intentionally a compact report, but the data model can be extended with campaign IDs, event locations, session attendance, meetings completed, or downstream CRM outcomes.
The API surface
The main routes are:
GET / Branded event microsite
POST /api/chat Browser chat
POST /api/followup Schedule attendee follow-up
GET /api/report Lead attribution report
POST /webhook/sms Inbound SMS
POST /webhook/whatsapp Inbound WhatsApp
POST /webhook/voice Voice integration scaffold
GET /health Health check
Messaging webhooks are verified with the Telnyx Ed25519 signature before their payloads are accepted. The interaction routes also use KV-backed limits: ten messaging requests, five voice events, or twenty browser-chat requests per identifier in a 60-second window.
Run it locally
Clone the examples repository and enter the project:
git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/event-sponsorship-agent
npm install
npm test
The project includes a local development adapter with in-memory KV, SQLite, and stubbed communications calls. This lets you open the microsite and exercise the chat, lead, rate-limit, and reporting flows without sending real messages.
For an Edge deployment, configure the actor, SQLDB, KV, Telnyx binding, and required secrets in telnyx.toml, then ship it:
telnyx-edge types
telnyx-edge ship
Keep DEMO_MODE=true while testing. Before enabling real communications, replace every placeholder, configure approved sending resources, verify webhook signatures, and review the applicable messaging requirements.
Where this pattern goes next
This example is framed around event sponsorship, but the architecture applies anywhere one real-world relationship needs persistent context across communications:
- Conference attendee concierge
- Trade-show lead qualification
- Field marketing follow-up
- Partner onboarding
- Customer success events
- Product-launch registration and support
The useful pattern is not simply "add a chatbot to a microsite." It is giving each attendee a durable agent that can remember the conversation, act across channels, and connect the interaction to measurable business outcomes.
Resources
- Event Sponsorship Agent source code
- Telnyx Edge Compute documentation
- Telnyx messaging documentation
- Telnyx AI Inference documentation
- Telnyx AI skills and toolkits
- Create a Telnyx account
What would you want an event agent to do next: sync with a CRM, coordinate meeting availability, or score leads using post-event behavior?
Top comments (0)