<!-- https://tinyactors.dev/guides/ -->
# Guides · tinyactors

Kind: reference. For: [Agent-platform engineer](https://tinyactors.dev/audiences/agent-platform.xml), [Workflow developer who tests](https://tinyactors.dev/audiences/workflow-tester.xml), [Tech lead who approves dependencies](https://tinyactors.dev/audiences/tech-lead.xml).
Voice: [Reference](https://tinyactors.dev/voices/reference.xml).

> Steps for each task with tinyactors, from writing a chart to running millions of actors, each with a program that runs.

Each program shown with its output runs in the site's tests against the published package, and must print what the page shows.

<a id="charts"></a>

## Write and test charts

- **[Writing charts](https://tinyactors.dev/guides/charts/index.md)**: A chart's code is JavaScript that reads the actor's variables by name, and your charts compile into one image.
- **[Testing your charts](https://tinyactors.dev/guides/testing/index.md)**: Advance a simulated clock and see how a WebSocket reacts when a reconnect attempt succeeds or fails.
- **[Testing recipes](https://tinyactors.dev/guides/testing-recipes/index.md)**: See examples for testing timers, service replies, and a payment that retries.
- **[The quickjs sandbox](https://tinyactors.dev/guides/quickjs/index.md)**: A chart your users upload runs in a separate engine, where a runaway loop ends in an error.

<a id="world"></a>

## Connect actors to your code and other hosts

- **[I/O processors](https://tinyactors.dev/guides/io-processors/index.md)**: A chart asks for outside work by sending an event, and an object of yours answers with another.
- **[Invoked services](https://tinyactors.dev/guides/services/index.md)**: A connection opens when a chart enters a state and closes when it leaves.
- **[Other systems](https://tinyactors.dev/guides/other-systems/index.md)**: An actor sends to an actor on another machine by its address, over a wire you write.
- **[When the actor is not there](https://tinyactors.dev/guides/missing-actors/index.md)**: Choose, for each kind of actor, what a send does when its target is not running.

<a id="operate"></a>

## Run a host in production

- **[Capacity and memory](https://tinyactors.dev/guides/capacity/index.md)**: A started actor takes about 530 bytes on Node.js, and a hibernated one about 120.
- **[Hibernation](https://tinyactors.dev/guides/hibernation/index.md)**: Two million actors ran with at most 1000 in memory and the rest as bytes in a database.
- **[Migration](https://tinyactors.dev/guides/migration/index.md)**: Running actors move to their chart's next version and keep the state they reached.
- **[Snapshots](https://tinyactors.dev/guides/snapshots/index.md)**: A host of two million actors copies into a 165 MB snapshot that another process restores.
- **[Journal and replay](https://tinyactors.dev/guides/journal/index.md)**: Record every input your program gives a host, and one loop rebuilds every actor after a crash.
- **[Inspecting a host](https://tinyactors.dev/guides/inspection/index.md)**: Ask a running actor which state it is in, and count what each chart has done.
- **[Telemetry](https://tinyactors.dev/guides/telemetry/index.md)**: Each step an actor takes becomes a span in your OpenTelemetry collector.

<a id="browser"></a>

## Run actors in a browser or a Worker

- **[In the browser](https://tinyactors.dev/guides/browser/index.md)**: Change one import, and your charts run in a page or a Worker.
- **[In a Cloudflare Worker](https://tinyactors.dev/guides/workers/index.md)**: One Durable Object holds thousands of actors, and its SQLite storage keeps them across an eviction.
