Trax .NET
Trax makes sure a process happens in the right order, by the right people, with nothing skipped, whether a person, a script or an AI agent is doing the work.
You define the process once, in C#. Any client can drive it, and the server checks every move and refuses a bad one with a typed error that says why. Every run is recorded in your own database. Trax is MIT licensed and targets .NET 10.
New here? Read Trax in five minutes: what Trax is for, in pictures, with no code.
Pick your way in
Deciding whether Trax fits
- Trax in five minutes: the problem, the idea, and how the pieces fit.
- What Trax does: every capability on one page, and where each is taught.
- Trax compared: with Temporal, Durable Functions, Elsa, MassTransit, XState, Hangfire and Quartz.NET, and when each is the better fit.
- Versioning and stability: what a release may change, and what Trax runs on.
- Samples: complete applications you can run.
Building with it in .NET
- Quick start: one app from an empty folder, in-process to GraphQL.
- Trains and junctions: what a train is and how it runs.
- Test a train: with in-memory effects, no database.
- The Trax book: a whole shop, one feature per chapter.
Putting AI agents to work on it
- Trax and AI agents: where Trax sits around an agent, and why its evidence is rerun.
- Board: scripted agents work tickets, and the server checks their evidence.
- Train or machine: which one a piece of work needs.
- State machines: states, moves and the guarantees the server keeps.
- Authorization rules: nothing is served until a rule allows it.
Running it in production
- Operations console: finding, reading and requeuing runs.
- How retries work: backoff, dead letters and requeues.
- Deployment topologies: one host, or a hub and workers.
- Troubleshooting: startup and runtime errors, verbatim.
The Glossary gives every Trax name its plain meaning.
Where to go
How these docs are organised explains the four kinds of page below.
Learn
- The Trax book: build one shop from an empty folder to a deployed hub, workers and a React storefront, one feature per chapter.
- Getting Started: build a server with one train, record its runs in Postgres, schedule it, open the operations console and call it over GraphQL.
Do
- Set up the scheduler: install it, configure it, and schedule a train.
- Run a job once, later: delayed and one-off runs.
- Handle dead letters: retry or acknowledge runs that ran out of retries.
- Secure a GraphQL host: authentication, authorization and hardening, end to end.
- Add a domain data context: your own EF Core tables next to Trax's.
- Debug with the log table: follow a run across
processes through
trax.log. - Test your trains: unit and in-memory tests.
- Author a state machine: define one and serve it.
Understand
- Trax in five minutes: what Trax is for, in pictures.
- What Trax does: every capability, with where to learn and read about it.
- Trains: trains, junctions, and how a chain runs.
- Decisions: a branch in a chain as a typed question a rule or a model answers.
- Checkpoints and branches: steps side by side, and resuming a failed run.
- Recording runs: what an effect is and how runs get recorded.
- Calling a train by its input: the train bus, queued work and nested trains.
- Scheduling: manifests, the work queue, and how jobs are dispatched.
- How retries work: backoff, dead letters and requeues.
- Choosing where trains run: in the host, on worker processes, over SQS or in Lambda.
- The GraphQL API: trains as queries and mutations, and query models.
- Persisted operations: a server that runs only the documents you registered.
- Operations console: what an operator sees and can do.
- State Machines: snapshots and definitions, the guarantees, and the matching C# and TypeScript runtimes.
- Train or machine: which one a piece of work needs.
- Authorization: where Trax checks who may run what.
- Architecture guards: tests that keep an application in the shape Trax expects.
- Deployment topologies: the ways to split an application across processes, and the sample that runs each.
- Trax compared: with Temporal, Durable Functions, Elsa, MassTransit, XState, Hangfire and Quartz.NET, and when each is the better fit.
- Versioning and stability: what a release may change, and what Trax runs on.
Look up
- SDK Reference: every public type and method.
- Packages: every package, what it is for, and which to install.
- Glossary: the names Trax uses.
- CLI: the
traxcommand, which scaffolds a project from a GraphQL schema or OpenAPI spec. - Troubleshooting: startup and runtime errors, verbatim, with the fix.
- Schema migrations: what each release changes in the database.