---
title: "Stateful Actors: Per-Entity State Without a Database | Telnyx"
canonical: https://telnyx.com/products/stateful-actors
---
# Stateful Actors: Per-Entity State Without a Database | Telnyx

**EDGE COMPUTE**

# StatefulActor

Durable, consistent state for every entity in your application. No database to manage, no locks to write, no race conditions to debug.

[Start Building](https://telnyx.com/sign-up)[CONTACT US](https://telnyx.com/contact-us)

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.

* ### One platform for telecom and compute  
Voice, messaging, storage, compute, and inference on a single API. Your application talks to the same infrastructure that carries the call, stores the data, and runs the model. No patchwork of vendors to reconcile.
* ### Private network, not the public internet  
Traffic between your functions, storage, and telephony stays on the Telnyx private network. Lower latency, no exposure to public internet routing, no hop through a third-party cloud.
* ### Carrier-grade reliability  
Telnyx infrastructure carries production voice and messaging traffic for enterprises globally. The same network that handles millions of calls powers your edge compute workloads. Tier-1 backbone, redundant routing, 24/7 NOC.

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.

[Read the docs](https://developers.telnyx.com/docs/edge-compute/stateful-actors)

TypeScript

```
// 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')) || [];
  }
}
```

BINDINGS

## What Actors connects to on the platform.

[See all products](https://telnyx.com/products)

* ### Functions  
Functions call actors through a binding. A stateless function delegates stateful operations to an actor instance. No credentials, no network hop.  
[Learn more](https://telnyx.com/products/functions)
* ### CloudFS  
Mount a POSIX filesystem on any host or container. Actors can read and write files that persist across restarts, with concurrent access from multiple instances.  
[Learn more](https://telnyx.com/products/cloudfs)
* ### KV  
Actors read and write KV for shared state. Session data written by a function is readable from an actor, and vice versa. One store, no sync step.  
[Learn more](https://telnyx.com/products/kv)
* ### Inference  
Actors can invoke inference models for real-time AI workloads. Call state persists across turns, so the actor remembers conversation context between model calls.  
[Learn more](https://telnyx.com/products/inference)

## 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.

[SIGN UP](https://telnyx.com/sign-up)[TALK TO US](https://telnyx.com/contact-us)

## 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.

[SIGN UP](https://telnyx.com/sign-up)[TALK TO US](https://telnyx.com/contact-us)

## FAQ

### What is a stateful actor?

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.

### What does "one instance per name" mean?

### How are actors different from edge functions?

### What happens when an actor restarts?

### Are Stateful Actors production-ready?

### How do actors compare to Cloudflare Durable Objects?

### What are typical use cases for actors?

### How do I get started?

[Start building](https://telnyx.com/sign-up)