Explanation

What Trax does

Trax is built around one thing: the train, a class that does one piece of business work as a chain of small steps called junctions. Everything else in Trax is a way to use that same class. The database records every run of it. The mediator, the scheduler and workers decide when and where it runs. The GraphQL API and the operations console let a client or an operator call it and watch it. A state machine walks a user through a longer process and runs trains along the way. You write the train once, and each of these attaches to it without changing it.

                          ┌──────────────────────────────┐
  your code ─────────────►│                              │
  a GraphQL client ──────►│           a train            │───► a run record
  the scheduler ─────────►│  junction → junction → ...   │     (when, how it ended,
  a worker process ──────►│                              │      which step failed, why)
  a state machine ───────►│                              │            │
                          └──────────────────────────────┘            ▼
                                                            the operations console

The Glossary gives each Trax name its plain equivalent. The tables below list what Trax does, grouped the way the book teaches it. Each row names the chapter that builds it in a real application, the page that explains it, and the package to install (Packages has the full list).

Write the work

CapabilityIn plain wordsLearn itUnderstand itPackage
Trains and junctionsOne operation as typed steps; a failing step stops the rest and the caller gets the exception.Chapter 1Trains and junctionsTrax.Core
MemoryEach step's output is handed to later steps by its type, with no wiring code.1.6MemoryTrax.Core
The startup chain checkA host whose chain can never run refuses to start, naming the step and the missing type.1.9Startup chain checkTrax.Mediator
DecisionsA branch in the chain is a typed question a decider answers: a rule, a lookup or a model. Answers can be recorded and replayed.Chapter 5DecisionsTrax.Core
Parallel steps and checkpointsSteps that run side by side, and a saved point a failed run resumes after.Chapter 14Checkpoints and branchesTrax.Core
TestingTest a step on its own, a train on in-memory storage, and the whole host as a client calls it.Chapter 2TestingTrax.Effect.Data.InMemory

Record every run

CapabilityIn plain wordsLearn itUnderstand itPackage
The run recordEvery run is a row: its input, output, timing, and the step and exception that failed it.Chapter 3Trax.EffectTrax.Effect and a data provider
Your own tablesYour application's EF Core data beside Trax's, in the same database.Chapter 4Domain data contextsTrax.Effect.Data.Postgres
Run eventsLifecycle hooks and junction events, pushed to other processes and to browsers.Chapter 10How event broadcasting worksTrax.Effect

Run it when and where you need

CapabilityIn plain wordsLearn itUnderstand itPackage
Calling a train by its inputRun a train by handing over its input, without referencing the class.Chapter 2MediatorTrax.Mediator
Queued workAsk for a run now and let it start when there is room, capped per train.Chapter 11Queued workTrax.Mediator
SchedulesCron, intervals, one-off delays, and trains that run after another succeeds.Chapter 9SchedulingTrax.Scheduler
Retries and dead lettersRetry with backoff, then park the run for an operator to requeue or acknowledge.Chapter 10How retries workTrax.Scheduler
WorkersRun the same trains in other processes, over HTTP, SQS or AWS Lambda, and recover a run whose worker died.Chapter 11Deployment topologiesTrax.Scheduler

Serve it

CapabilityIn plain wordsLearn itUnderstand itPackage
AuthorizationNothing is served until a rule says who may call it; an unguarded train stops the host.Chapter 6Authorization rulesTrax.Effect (the attributes), Trax.Api.Auth (sign-in)
GraphQLTrains become typed queries and mutations, and query models become filterable queries.Chapter 7The GraphQL APITrax.Api.GraphQL
The operations consoleEvery run, schedule, dead letter and machine in one place, with requeue and cancel.Chapter 8Operations consoleTrax.Api.Dashboard
Generated clientsA typed TypeScript client generated from the documents your frontend writes.Chapter 15Trax CLIthe trax tool
Persisted operationsThe server runs only the GraphQL documents you registered and refuses the rest.Chapter 17Persisted operationsTrax.Api.GraphQL.PersistedOperations

Walk a user through a process

CapabilityIn plain wordsLearn itUnderstand itPackage
State machinesA long-lived flow (a checkout, a form) as named states the server and the browser agree on.Chapter 12State machinesTrax.StateMachine
A machine runs a trainA state starts a train and moves on with its result.Chapter 13Train or machineTrax.StateMachine
The browser twinThe same machine in TypeScript, so the browser predicts each move before the server confirms it.Chapter 16State machines@traxsharp/state-machine

Ship it

CapabilityIn plain wordsLearn itUnderstand itPackage
DeploymentOne host, or a hub and workers against one Postgres and RabbitMQ, with health checks.Chapter 18Deployment topologies
Architecture guardsTests your build runs to keep trains, junctions and registrations in the shape Trax expects.Chapter 2Architecture guardsTrax.Core.Testing

SDK Reference

ServiceTrain | AddMediator | AddScheduler | AddTraxGraphQL