How it works

The work is the log.The worker is replaceable.

One Postgres log. Workers can die. The workflow does not.

W1demo-worker-1 · aliveW2demo-worker-2 · leasedW3demo-worker-3 · idleNXNext.js · demo keyUIBrowser · this pageENGINEEVENT #128ActivityCompleted

Workers can die

Workers lease tasks, run activities, and heartbeat. Kill one mid-run and another worker finishes the order.

History is the truth

Accepted commands land in Postgres in the same transaction as the follow-up work. The log keeps printing.

PAYPaymentsCRECreditACCAccountsREPReportcalling · payments

Activities hit real services

Charges, credits, accounts, and reports go over HTTP. Flip payments or credit from the live demo and watch the workflow react.

AFTER KILLrec 2700ms

Recovery is bounded

A dead worker loses its lease. Another continues. Time to resume is lease length plus the poll interval.

Guarantees

What survives a crash.

01Same transaction

Accepted commands are stored in Postgres in the same transaction as the follow-up work. A worker or engine crash does not drop that progress.

02Recorded once

Each activity result is recorded at most once. History never has two ActivityCompleted events for the same command.

03Lease moves on

A dead worker loses its lease. Another worker continues. Recovery is bounded by the lease time plus the poll interval.

04Late work is rejected

A late completion from a worker that lost its lease is rejected.

05Retries with backoff

Failed activities retry with backoff, up to the configured limit.

06Timers still fire

Timers still fire if the engine was down when they came due.

07Commands stay deterministic

Workflow code that changes its commands is rejected as non-deterministic.

Limits

What this demo does not promise.

01At least once

Activities run at least once. A crash after the side effect and before the result is recorded runs the activity again. Duplicate side effects stay gone only when the activity sends the same idempotency key.

02One database

One Postgres database and one engine process. This is not a highly available cluster.

03A demo

Not production grade. The demo uses a shared key, one tenant, and no workflow versioning.