Flux is a backend runtime that records every execution automatically. When something breaks, you don't guess. Replay the exact production traffic. Diff two executions. Bisect the commit that introduced the bug.
Functions, database, queue, and cron are built in โ because recording requires controlling the full stack.
One core concept: the execution record.
Every request Flux handles becomes an execution record โ a complete snapshot of what the request did: gateway spans, function spans, database mutations, inputs, outputs, tool latencies, and async hand-offs. The commands below are different ways to query and act on that record.
Flux CLI commands map directly to the questions developers ask when something breaks in production.
| Developer Question | Command | What it does |
|---|---|---|
| Inspect | ||
| Why did my request fail? | flux why <id> | Root cause, span tree, suggestions |
| What happened step by step? | flux trace <id> | Full span tree with latencies |
| How does my query get compiled? | flux explain | Dry-run with policy + SQL preview |
| Replay | ||
| What happens if I replay this? | flux incident replay | Safe re-run, side-effects off |
| Compare | ||
| How do two requests differ? | flux trace diff | Span-by-span comparison |
| Which commit introduced this bug? | flux bug bisect | Binary-searches git history |
| Audit | ||
| What changed in the database? | flux state history | Every row mutation, linked to request |
| Who set this field to this value? | flux state blame | Per-column last-write attribution |
The Flux runtime captures a complete record of every request as it happens โ gateway auth, function spans, every database query, tool latencies, async job hand-offs. Whether your function runs on Deno V8 (TypeScript) or Wasmtime (Rust, Go, Java, Python, PHP, AssemblyScript) โ same recording, same traces.
flux trace debug <id> opens an interactive terminal UI where you can navigate each span of a production request. See the exact input and output at every step โ what the gateway received, what the function returned, what the database wrote. All from the actual production execution.
flux state history shows every INSERT, UPDATE, and DELETE on any row, linked back to the request that caused it. flux state blame shows which request owns each column's current value. Instantly answer "who or what set this field to this value?"
flux incident replay re-executes all requests from a time window against your current code. Outbound side-effects are disabled โ no emails, no webhooks, no Slack. Database writes and mutation logs run normally. After your commit, replay the incident to confirm the fix before deploying.
flux bug bisect binary-searches your git history comparing trace behaviour before and after each commit. It automatically identifies the first commit where a given request started failing. Like git bisect, but for production behaviour rather than a test suite.
Flux is a runtime โ your code runs inside it. That's what makes replay and mutation logging possible. But you don't adopt a runtime all at once. Here's the path:
Try it locally (5 minutes)
flux init โ flux dev โ curl. You have execution traces before you finish reading the quickstart. No infra changes. Nothing deployed.
Move one endpoint (30 minutes)
Pick a new or low-risk endpoint. Wrap it in defineFunction(). Deploy Flux on :4000 behind your existing proxy. Everything else stays on your current stack.
Compare debugging speed
Next time that endpoint fails in production, run flux why. Compare the experience to your Datadog/Sentry/grep workflow. The difference sells itself.
Migrate gradually
Move more endpoints when you see the value. Flux and your existing stack run side-by-side behind the same proxy. No big-bang cutover.
Side-by-side deployment
Recording is built into the runtime at the Rust level โ not added as middleware on top. Spans flow through in-memory channels. Mutation logs piggyback on the same Postgres transaction as your data.
Everything on this page is available when you run flux dev. No cloud account, no configuration, no SDK changes.