TELNYX EDGE COMPUTE

Stateful Actors

Durable, consistent state for every entity in your application. No database to manage, no locks to write, no race conditions to debug. The platform handles routing, persistence, and concurrency for you.

CiscoOpenAITalkdeskAmerican Red CrossZillowMicrosoftCosmoIBMState of IowaCiscoOpenAITalkdeskAmerican Red CrossZillowMicrosoftCosmoIBMState of Iowa
WHY TELNYX

Built for state that lives at the edge

Stateful Actors on Telnyx run colocated with telephony termination, so call-leg and messaging workloads stay where calls land, not in a distant cloud region. That means lower latency for real-time voice and messaging. And actors are part of a broader platform: Functions, KV, Object Storage, and Inference on one account, one API, one bill.

FEATURES

Durable state without the database overhead

The actor model handles locking, routing, and persistence for you. You write a class with methods. The platform does the rest.

  • Consistent per-entity state

    Every request for the same entity routes to the same instance. Two requests for the same user, same cart, same call leg always hit the same state. The platform handles routing automatically, no coordination logic required.

  • No race conditions

    Requests are handled one at a time within each actor. No locks, no mutexes, no transaction blocks. Race conditions are structurally impossible because the platform serializes access for you.

  • Survives restarts

    Writes are flushed to persistent storage before the caller gets a response. If an actor restarts, it recovers its committed state automatically. You never lose acknowledged work.

  • Just write a class

    Define a TypeScript class with methods for your entity logic. The platform handles routing, serialization, and persistence. No workflow definitions, no state machine DSL, no infrastructure config files.

  • Fast reads, safe recovery

    State lives in memory for fast reads on the hot path, with durable storage for recovery. You get speed and safety without managing either one yourself.

  • Runs where your calls land

    Actors run on the same edge infrastructure as Telnyx Functions, colocated with call termination. Lower latency for real-time voice and messaging workloads.

HOW IT WORKS

Define a class. Deploy. The platform does the rest.

Write a TypeScript class with your business logic. The platform routes requests, serializes calls, persists writes, and recovers state on restart. Your code is just the logic that matters.

// Define a stateful actor class
export default class CartActor {
  constructor(private state: DurableObjectState) {}

  async addItem(item: { id: string; qty: number }) {
    let cart = (await this.state.storage.get('cart')) || [];
    cart.push(item);
    await this.state.storage.put('cart', cart);
    return cart;
  }

  async getCart() {
    return (await this.state.storage.get('cart')) || [];
  }
}
PRODUCTS

Everything you need to build, run, and scale

Sign up and start building.

Get an API key, deploy your first actor, and tell us what you are building. We are actively working on the roadmap and want your feedback.

FAQ

A stateful actor gives each entity in your application its own durable, consistent state. Every request for the same entity, like a shopping cart or a call leg, hits the same instance every time. You get read-modify-write semantics without locks, transactions, or an external database.