Explanation

Trax compared with Elsa and MassTransit

Checked on 2026-11-05 against the Elsa 3 docs and the MassTransit 9 docs. Corrections are welcome as issues.

Elsa Workflows 3 is an MIT-licensed workflow engine you embed in a .NET app. Workflows are written in C#, as JSON, or in Elsa Studio, a visual designer. An instance suspends at a bookmark (a delay, a timer, an event, an HTTP endpoint) and resumes when something triggers it. MassTransit is a .NET message bus. Its saga state machines react to messages from a broker, correlated to an instance by id, and routing slips run multi-step work with compensation. MassTransit 9 and later need a paid licence; version 8 stays open source, and its commercial support ends on 2026-12-31.

Trax sits between them. Its state machines are declared in C# like a MassTransit saga, but they are driven by callers, through a typed API with a rule on every event, rather than by messages from other services.

Authoring

TraxElsa 3MassTransit
ModelTrains (typed step chains) and server-side state machinesAn activity graph: flowchart, sequence or state machineA saga state machine on message events; routing slips for step sequences
Written inC#C#, JSON, or the Elsa Studio designerC#
Visual designerNo. The operations console and trax machine show (Mermaid, DOT) draw a machine you wroteYesNo. A state machine visualizer package, and the 9.2 dashboard preview
Change a workflow without redeployingNoYes, from JSON or the designerNo
GuardsDeclarative rules, or C# delegatesActivities and expressions in C#, JavaScript, Python or LiquidC# If and Then in During and Initially
Built-in activitiesNone: your junctions. A model-backed decider shipsHTTP, email, scheduling, messaging and morePublish, send and request
Passing data between stepsEach junction's output reaches later junctions by its type, with no wiringWorkflow variables bound to activity inputs and outputsSaga instance properties; routing slip variables
BranchingSwitch, Gate and Scale declare every track; a decider picks one per runFlowchart branches, If, SwitchIf and IfElse in a state machine
Decisions by a modelA decider can be a rule, a lookup or a model, with a confidence floor per track and a second decider in shadowAgent activities on Semantic KernelNot covered here
Parallel stepsParallel(...): fixed branches on copies of the run's data, joined before the next stepFork, Join, Parallel, ParallelForEachNot covered here: routing slips run in sequence
Checked before it runsThe host refuses to start if a chain can never run, naming the step and the missing typeNot covered hereNot covered here
In the IDEVS Code and Rider hints showing each junction's input and outputNot covered hereAn analyzer for message initializers

Long-running instances

TraxElsa 3MassTransit
Between stepsA stored snapshot, written after every moveA bookmark and a stored instanceA saga row, between messages
TimersA state's After(...), fired by the serverDelay, Timer, Cron and StartAt, on a local scheduler, Quartz or HangfireSchedule, which needs Quartz, Hangfire or a transport's scheduler
Other workA state invokes a train or spawns a child machineDispatch a workflow, child workflowsPublish, send, request, routing slips
CompensationDeclared by you: a reset or compensating edge (Undo an effect)Not covered hereRouting slips compensate in reverse order
New versions under running instancesVersion and MigrateFrom migrate each stored snapshot forward when it is loadedInstances keep their version; alteration plans move themChange the saga class and its data yourself
Resume a failed runFrom its last checkpoint, by an operator or over GraphQL; a requeue can replay the recorded decisionsIncidents; alterations can reschedule an activityRedelivery and retry of the message

Who may drive an instance

TraxElsa 3MassTransit
From outsideTyped GraphQL operations per machine: start, each event, get, watch, discardAn HTTP endpoint activity; a resume URL carrying a token; an authenticated event triggerNone built in: your API publishes a message
Rules per eventYes: Requires, RequiresPolicy, AnyAuthenticated, Anonymous; reads can be OwnerOnlyNo. API permissions cover a whole resourceNo. Your API checks before it publishes
DefaultClosed: a served machine missing a rule on any event, start or read, or a served train or query with no rule, stops the hostAn HTTP endpoint's Authorize defaults to false; the resume token is a bearer capability; since 3.8 the server needs bootstrap credentials to startNot applicable
Instances per ownerYesNot covered hereNot applicable

Concurrency and delivery

TraxElsa 3MassTransit
Two writers on one instanceOptimistic: a concurrency token on the snapshot row; a conflict is a typed resultA distributed lock per instance (a file lock by default, which is single-machine)Pessimistic row lock by default with EF Core; optimistic is optional
A retried requestThe first answer is replayed from the instance's recent request idsNot covered hereThe inbox removes duplicates by message id
Irreversible side effectsRunsOnce<TEffect>(): recorded once, called again only under the same key after a crashYoursYours: consumers must be idempotent
OutboxOnly for invoked trains: the snapshot and the queued run commit togetherAn opt-in outbox for dispatching workflows, at least onceTransactional outboxes on the bus and the consumer, with an inbox
Message brokerNot for machines. Optional RabbitMQ for broadcasting run events, SQS for running jobs on workersOptional, through MassTransitRequired: RabbitMQ, Azure Service Bus, SQS, ActiveMQ, SQL, Kafka and more

Storage and operations

TraxElsa 3MassTransit
DatabasesPostgreSQL; SQLite for a single process; in-memory for testsSQL Server, PostgreSQL, SQLite, MySQL, MongoDB and moreAbout ten saga stores, from EF Core to DynamoDB and Cosmos
Run historyEvery train run with input, output, timing, failure, each step and each decision; a machine's transitionsAn execution journal per instanceThe saga row holds the current state
In the browserThe same machine, through @traxsharp/state-machine; the server refuses a send whose prediction differs from its own resultNoNo
UIThe operations consoleElsa Studio, for design and runtimeA dashboard, in preview in 9.2
TracingNo OpenTelemetry spans for runs or transitions; meters through System.DiagnosticsOpenTelemetry spans and metricsOpenTelemetry spans and metrics across message hops
LicenceMITMIT, with paid extras9 and later: commercial. 8: open source

Scheduling and queued work

TraxElsa 3MassTransit
SchedulesCron with seconds, intervals, one-off delaysCron, Timer, Delay, StartAtRecurring messages through Quartz or Hangfire; cron for job consumers
ExclusionsDays, dates, date ranges and daily time windows, per scheduleNot covered hereNot covered here
Missed runsFire once now, or do nothing, per scheduleOnly StartAt catches upNot covered here
Work after other workDependent schedules run after a parent succeeds; dormant ones wait for the parent to start them with its own inputDispatch a workflow from a workflowYour consumer publishes the next message
LimitsA global cap and a cap per group of schedules; priority 0 to 31Activation strategies; worker countsConcurrency limits per job type; a partitioner per key
One at a time per subjectQueued runs that share a subject key run one after anotherOne running instance per correlation idUsePartitioner, on one bus instance
RetriesPer schedule, with backoff, resumed from the last checkpointQuartz retries; incident strategiesRetry and redelivery middleware
Out of retriesA dead letter an operator requeues or acknowledges, in the console or over GraphQLNot covered here_error and _skipped queues, Fault<T> messages
WorkersThe same trains over HTTP, SQS or AWS Lambda, with signed requests; a dead worker's runs are recoveredA distributed runtime with a shared lock; Quartz clusteringAny transport

Serving it

TraxElsa 3MassTransit
An API for plain workEach train is a typed GraphQL mutation that runs or queues it; your EF entities become filtered, paged queriesA REST management API; HTTP endpoint activitiesNone
Only known requestsPersisted operations: the server runs only the GraphQL documents it registeredNot covered hereNot applicable
Clientstrax client writes a typed TypeScript or React client from your .graphql files, or a .NET oneElsa.Api.Client, .NET onlyNone
Live updatesRun and machine subscriptions; run events over SignalR and RabbitMQSignalR, for StudioA SignalR backplane
Who may call itEvery exposed train and query needs [TraxAuthorize] or [TraxAllowAnonymous], or the host does not startAn Authorize flag per endpoint; resource permissionsYour API
AuditEvery API call through an audit sink with secrets redacted; [TraxSensitive] masks stored inputs and outputsNot covered hereNot covered here
OperatorsThe web console, and trax-console in a terminal, with a JSON lines mode for scriptsElsa StudioA dashboard, in preview

Testing and tooling

TraxElsa 3MassTransit
TestingJunctions as plain classes; trains on an in-memory provider; whole-host testsActivityTestFixture, WorkflowTestFixtureITestHarness and a saga harness
Architecture guardsTest packages that fail the build when trains, registrations or schemas drift from Trax's shapeNot covered hereNot covered here
Templatestrax-api, trax-scheduler, trax-hubelsa-server, elsa-studio, elsa-combinedNot covered here
CLItrax generate trains from OpenAPI or GraphQL; trax machine and trax client generate code and check itNot covered hereNot covered here

AI agents

TraxElsa 3MassTransit
An agent as a clientThe same API and rules as a person; a move that needs evidence is rerun by a train on the server (Board)Not covered hereNot applicable
Models inside the workModel-backed deciders, each answer recorded and replayed on a retryElsa.Agents on Semantic Kernel; a Studio assistantNot covered here
Coding agentsAgent skills published with each release; llms.txtllms.txtCoding agent skills; llms.txt

When to choose Elsa

  • People who do not write code need to build or change workflows in a designer.
  • You want to change workflow definitions at runtime, without a deploy.
  • You want ready-made HTTP, email and messaging activities, or expressions in JavaScript, Python or Liquid.
  • Your database is SQL Server, MySQL or MongoDB.
  • You need OpenTelemetry spans for every workflow and activity today.

When to choose MassTransit

  • The system is message-driven across services, and the state machine reacts to events from other services rather than to users.
  • You need a choice of broker, and a general transactional outbox and inbox.
  • You need routing slips that compensate across services automatically.
  • You need tracing across message hops.

When to choose Trax

  • The instance is driven by people or agents through an API, and the server has to check each event against the caller and the input.
  • You want the page to predict the next state with the same machine the server runs.
  • You want the work as plain typed C# steps whose wiring is checked when you build and when the host starts.
  • Some steps are decided by a model, and each answer should be recorded, held to a confidence floor and replayed on a retry.
  • You need a full scheduler in the same packages: exclusions, misfire rules, dependent and dormant schedules, group caps, priority, and dead letters an operator requeues.
  • The same work has to run on HTTP workers, SQS or Lambda without a message bus.
  • The frontend should get a typed client generated from its own queries, and the server should refuse any query it did not register.
  • You want every run recorded in your own Postgres, and no broker between a caller and the machine.

Using them together

A junction can publish a MassTransit message, so a Trax train can start work in a message-driven system. A Trax machine can sit in front of it, deciding which caller may start what, while MassTransit carries the messages behind it.