# tinyactors > Statechart actors inside your own process: logic you can reason about, inspect and check, with no infrastructure to adopt. tinyactors runs the rules that tell your application how to respond to events. Run those same rules in tests with a clock you control, then inspect the decisions they make in production. ## Packages - @tinyactors/node 0.4.0 (Node.js and Bun): `npm install @tinyactors/node` - tinyactors 0.4.0 (Python): `pip install tinyactors` - @tinyactors/wasm 0.4.0 (Browsers): `npm install @tinyactors/wasm` - tinyactors-core 0.5.0 (C): `curl -L https://github.com/tinyactors-dev/tinyactors-core/releases/download/v0.5.0/tinyactors-0.5.0-src.tar.gz | tar xz` ## Audiences - [Agent-platform engineer](https://tinyactors.dev/audiences/agent-platform.xml): A senior backend engineer building a multi-tenant backend for AI agents, chats or realtime sessions, in Node.js or Bun, evaluating a runtime for one long-lived stateful unit per session or tenant. - [Workflow developer who tests](https://tinyactors.dev/audiences/workflow-tester.xml): A backend developer, often in Python, whose long-running business logic (retries, timeouts, payments, multi-day waits) is hard to test and has been hand-rolled as state machines or considered for Temporal. - [Tech lead who approves dependencies](https://tinyactors.dev/audiences/tech-lead.xml): An architect or tech lead deciding whether the team may depend on tinyactors across services, clients and devices (Node.js, Python, the browser, C), and accountable when it fails. ## Voices - [Reference](https://tinyactors.dev/voices/reference.xml): The developer voice at its plainest, and the rules every other voice keeps: facts a reader looks up, said once, with the product as the subject. - [Pitch](https://tinyactors.dev/voices/pitch.xml): A peer with an opinion about what makes software hard, showing a reader who is deciding what tinyactors does about it, with proof under every claim. - [How-to](https://tinyactors.dev/voices/how-to.xml): A colleague's runbook: the situation the reader is in, the steps that get them out, and what each line of code does. - [Tutorial](https://tinyactors.dev/voices/tutorial.xml): Someone at the learner's side: each step says what to do, what they will see and why it matters for what they are building. - [Explanation](https://tinyactors.dev/voices/explanation.xml): A chapter of a book that argues: a reader follows it from start to end to understand a design, and its costs, before depending on it. - [Dario](https://tinyactors.dev/voices/dario.xml): A first-person account of figuring something out, with enough detail for the reader to follow the reasoning or try the thing themselves. ## Pages - [tinyactors · Verifiable logic for live systems](https://tinyactors.dev/index.md): An open-source runtime for statecharts that you can simulate, inspect and update inside your application. - [Recipes · tinyactors](https://tinyactors.dev/recipes/index.md): Ten applications built with tinyactors, from a shop's orders to a game server that survives being killed, each with its problem, the features it uses and its source. - [A million ants in your browser](https://tinyactors.dev/anthill/index.md): Two anthills in a browser tab, where every ant and queen is a tinyactors actor running on WebAssembly. - [Property testing a statechart](https://tinyactors.dev/property-testing/index.md): Replace unit tests with properties: generate worlds from seeds, find the run that breaks the chart, shrink it, and read its trace. In your browser. - [Telemetry: every step is a span](https://tinyactors.dev/telemetry/index.md): tinyactors reports what its actors do as OpenTelemetry: a span for each step, logs and metrics, with W3C trace context across actors and systems. - [Memory, capacity and performance](https://tinyactors.dev/performance/index.md): What a tinyactors actor costs in memory, how to size a host, how each operation's cost holds as the population doubles, and its conformance to SCXML. - [Why tinyactors exists](https://tinyactors.dev/about/index.md): Why tinyactors exists, who maintains it, its license, where its source is and how it is released. - [Testing recipes](https://tinyactors.dev/guides/testing-recipes/index.md): Examples for testing chart timeouts, retries, and service replies with Tiny Actors. ## Docs - [Overview](https://tinyactors.dev/docs/index.md): Everything about tinyactors in one place: the quickstart, the ideas behind statecharts and actors, the guides, the command line, the reference and the design. - [Quickstart](https://tinyactors.dev/docs/quickstart/index.md): Install tinyactors in Node.js, Python, a browser or C, and run an order actor that retries its payment on its own, in five minutes. - [Statecharts in ten minutes](https://tinyactors.dev/docs/statecharts/index.md): What statecharts and actors are, shown on one order chart you can drive: states and events, guards, the data model, nested and parallel states, timers, effects and actors. - [Tutorial: a team chat](https://tinyactors.dev/chat/index.md): Try a team chat in your browser, then build it in nine steps, from one room to direct messages between two people. - [With a coding agent](https://tinyactors.dev/docs/agents/index.md): Connect a coding agent to the tinyactors support server for the guides, the skill for writing charts and known issues, and read every page of the site as Markdown. - [Architecture](https://tinyactors.dev/architecture/index.md): How tinyactors runs actors: a host, one segment per image, a system and its region of memory, the effects loop and snapshots. ## Guides - [All guides](https://tinyactors.dev/guides/index.md): Steps for each task with tinyactors, from writing a chart to running millions of actors, each with a program that runs. - [Writing charts](https://tinyactors.dev/guides/charts/index.md): Write an actor's behaviour as an SCXML chart in JavaScript, and compile your charts into one image a host runs. - [Testing your charts](https://tinyactors.dev/guides/testing/index.md): Use a simulated clock to step through a WebSocket reconnect and decide how the socket replies. - [The quickjs sandbox](https://tinyactors.dev/guides/quickjs/index.md): Run charts your users upload in QuickJS, an engine inside the package that stops a runaway loop or allocation with an error. - [I/O processors](https://tinyactors.dev/guides/io-processors/index.md): Charts send events to I/O processors, objects of your own that do the I/O and send the answers back as events. - [Invoked services](https://tinyactors.dev/guides/services/index.md): Run a connection, a subprocess or a long computation for as long as a chart's state is active, with SCXML's invoke. - [Other systems](https://tinyactors.dev/guides/other-systems/index.md): Send events to actors in other processes and machines: a function you write carries each message, and the other host takes it unchanged. - [When the actor is not there](https://tinyactors.dev/guides/missing-actors/index.md): A send to a hibernated actor wakes it, and a send to no actor fails at once. Choose, for each kind of actor, how your application avoids or handles the failure. - [Capacity and memory](https://tinyactors.dev/guides/capacity/index.md): A tinyactors actor takes about 530 bytes started and 120 hibernated, and each operation costs about the same at four million actors as at two. - [Hibernation](https://tinyactors.dev/guides/hibernation/index.md): Keep only the busy actors in memory: the host writes the others to blobs in your store and wakes them when they have work. - [Migration](https://tinyactors.dev/guides/migration/index.md): Move running actors to a chart's new version, each at rest, keeping its session, states and queue while the host goes on working. - [Snapshots](https://tinyactors.dev/guides/snapshots/index.md): host.snapshot() copies a running tinyactors host into bytes, two million actors in 165 MB, and Host.restore runs the copy in this process or another. - [Journal and replay](https://tinyactors.dev/guides/journal/index.md): Record every input your program gives a tinyactors host, and replay the journal to rebuild every actor after a crash, without running any effect again. - [In a Cloudflare Worker](https://tinyactors.dev/guides/workers/index.md): Run a tinyactors host inside a Cloudflare Durable Object: thousands of actors in one object, idle ones in its SQLite storage, every actor kept across an eviction. - [Inspecting a host](https://tinyactors.dev/guides/inspection/index.md): Read which state a running actor is in and what its variables hold, and count what each chart has done. - [Telemetry](https://tinyactors.dev/guides/telemetry/index.md): Export each step an actor takes as an OpenTelemetry span, with its logs and metrics, as OTLP bytes your code sends to a collector. - [In the browser](https://tinyactors.dev/guides/browser/index.md): Run the charts you run on Node.js in a page or a Worker with @tinyactors/wasm, the same API on core compiled to WebAssembly. ## CLI - [Overview](https://tinyactors.dev/cli/index.md): Install the tinyactors command to compile, check, compare, draw and run charts and read application snapshots offline. - [Tutorial](https://tinyactors.dev/cli/tutorial/index.md): Compile an order chart, fix a misspelt timeout with tinyactors lint, trace the path to shipped and run an order session. - [CI checks](https://tinyactors.dev/cli/guides/ci/index.md): Fail pull requests on compile, tinyactors lint, tinyactors fmt --check or tinyactors diff --breaking --exit-code errors with a GitHub Actions workflow. - [JSON-RPC scripting](https://tinyactors.dev/cli/guides/scripting/index.md): Drive tinyactors run over JSON-RPC 2.0 to spawn orders, answer payment requests, hold batches, move the clock and generate a client. - [Offline snapshots](https://tinyactors.dev/cli/guides/snapshots/index.md): Read snapshot state, queued events, pending timeouts and hibernation blobs offline with tinyactors actors and tinyactors inspect. - [Cheat sheet](https://tinyactors.dev/cli/cheatsheet/index.md): Reference sheet of tinyactors CLI commands by task, covering compilation, validation, formatting, inspection, diffing, graphing, execution, and snapshot reading. - [CLI and libraries](https://tinyactors.dev/cli/why/index.md): Understand when to use the tinyactors command for CI checks, diffs, offline snapshots and scripting instead of the libraries. - [tinyactors compile](https://tinyactors.dev/cli/commands/compile/index.md): Compile charts or a system manifest into an image. - [tinyactors check](https://tinyactors.dev/cli/commands/check/index.md): Check that charts compile or that an image verifies. - [tinyactors inspect](https://tinyactors.dev/cli/commands/inspect/index.md): Show what an image, a snapshot or a blob holds. - [tinyactors states](https://tinyactors.dev/cli/commands/states/index.md): List each chart's states as a tree in document order. - [tinyactors transitions](https://tinyactors.dev/cli/commands/transitions/index.md): List each chart's transitions with events, conditions and targets. - [tinyactors events](https://tinyactors.dev/cli/commands/events/index.md): List every event name and the transitions, raises and sends using it. - [tinyactors data](https://tinyactors.dev/cli/commands/data/index.md): List each chart's data declarations. - [tinyactors expressions](https://tinyactors.dev/cli/commands/expressions/index.md): List each chart's expressions and scripts with where they are. - [tinyactors disassemble](https://tinyactors.dev/cli/commands/disassemble/index.md): List each chart's executable content instruction by instruction. - [tinyactors graph](https://tinyactors.dev/cli/commands/graph/index.md): Draw each chart, or list its boxes and edges. - [tinyactors diff](https://tinyactors.dev/cli/commands/diff/index.md): Compare two versions and show what changes for running actors. - [tinyactors lint](https://tinyactors.dev/cli/commands/lint/index.md): Find what cannot work as written in charts. - [tinyactors path](https://tinyactors.dev/cli/commands/path/index.md): Find the shortest path to a state: events, conditions and transitions. - [tinyactors fmt](https://tinyactors.dev/cli/commands/fmt/index.md): Rewrite charts and system manifests in the canonical layout. - [tinyactors actors](https://tinyactors.dev/cli/commands/actors/index.md): List every actor of a snapshot with its state and queues. - [tinyactors run](https://tinyactors.dev/cli/commands/run/index.md): Serve one host over JSON-RPC 2.0 on standard input and output. - [tinyactors help](https://tinyactors.dev/cli/commands/help/index.md): Describe a command or the program. - [tinyactors version](https://tinyactors.dev/cli/commands/version/index.md): Print the versions of the program and its library. ## Compare - [When to use](https://tinyactors.dev/when-to-use/index.md): Why tinyactors fits an embedded event loop, what a crash keeps and how it compares with Temporal, Durable Objects, Rivet and XState. - [Temporal](https://tinyactors.dev/compare/temporal/index.md): Where a workflow with retries and timeouts runs, how its tests move time, what a crash keeps, and when Temporal is the better choice. - [Durable Objects](https://tinyactors.dev/compare/durable-objects/index.md): Where a stateful session runs, what an idle one keeps, how its tests move time, what a deploy does to it, and when Cloudflare Durable Objects are the better choice. - [Rivet](https://tinyactors.dev/compare/rivet/index.md): Who places an actor, what a sleeping one keeps, how its tests move time, what a deploy does to running actors, and when Rivet Actors are the better choice. - [XState](https://tinyactors.dev/compare/xstate/index.md): Where a statechart runs, what format it is written in, what keeps a population of actors, how a running actor takes new logic, and when XState is the better choice. ## Optional - [@tinyactors/node API · tinyactors](https://tinyactors.dev/docs/node/index.md): Every class, function, interface and type of @tinyactors/node for Node.js and Bun, each with its signature and what it does. - [Python API · tinyactors](https://tinyactors.dev/docs/python/index.md): Every class, function and constant of the tinyactors package for Python, each with its signature and what it does. - [tinyactors changelog](https://tinyactors.dev/changelog/index.md): Every release of tinyactors for Node.js, browsers, Python and C: what changed, and what a program must change to upgrade. - [Reference · tinyactors CLI](https://tinyactors.dev/cli/commands/index.md): Browse every tinyactors command grouped by task and check the shared options accepted by all commands. - [Snapshot inspector](https://tinyactors.dev/inspector/index.md): Open a tinyactors snapshot in your browser: each segment's memory, every actor's chart and active states, its record and mailbox, and the traces at the time of capture. - [tinyactors blog](https://tinyactors.dev/blog/index.md): Announcements and essays from the maintainers of tinyactors: what they built, tried and measured, newest first. - [Site content namespace](https://tinyactors.dev/ns/site.md): The XML namespace of the content tinyactors.dev is written in: pages, sections, claims and examples. - [Site stylesheet functions namespace](https://tinyactors.dev/ns/site/functions.md): The XML namespace of the functions in the stylesheet that turns tinyactors.dev's content into pages. - [Audience namespace](https://tinyactors.dev/ns/audience.md): The XML namespace of an audience file: who reads a page, and what they need from it. - [Voice namespace](https://tinyactors.dev/ns/voice.md): The XML namespace of a voice file: the rules a kind of page is written by. ## Elsewhere - [GitHub](https://github.com/tinyactors-dev/tinyactors) - [npm](https://www.npmjs.com/package/@tinyactors/node) - [PyPI](https://pypi.org/project/tinyactors/)