How-to guide · local environment

Kill the workers and observe recovery

Run both acts with the deterministic fixture. The baseline loses its in-memory continuation, while the Temporal run resumes from recorded history.

Before you begin

Install Node.js 24 or later, npm, Docker, and Chromium for Playwright. The live Codex path also requires the codex CLI and a local Codex login.

Start the application

  1. Install the dependencies and Chromium:

    package installationshellscript
    npm install
    npx playwright install chromium
  2. Start Temporal:

    local servicesshellscript
    npm run temporal:up
  3. Build and start the application:

    demo servershellscript
    npm run build
    npm start
  4. Open the local demo. Temporal's development UI is available on port 8233.

For the Live Codex path, verify the Codex login and Temporal connection before you start the application:

live mode preflightshellscript
npm run preflight

Reproduce process-owned failure

  1. Select Baseline and Fixture.
  2. Click Start run.
  3. After the investigators begin, click Kill workers, then confirm Stop workers.
  4. Click Restart workers.

The baseline creates a fresh workspace and starts a new in-memory run. Its progress returns to the beginning.

Recover the history-owned run

  1. Select Temporal and Fixture.
  2. Click Start run.
  3. After at least one branch completes, click Kill workers, then confirm Stop workers.
  4. Inspect the open Workflow in Temporal's development UI.
  5. In the demo, click Restart workers.

The replacement Worker replays Event History, reuses recorded results, and continues unfinished Activities. The final receipt shows four passing tests and the one-line retry fix. The completed Workflow remains recorded after its run-specific Worker exits.

The browser stores only the selected mode, runner, and run IDs. After a page refresh, it reloads each snapshot from the API supervisor. Restarting the API clears its in-memory run registry, so browser persistence does not extend across an API restart.

Verify the repository

Run the automated checks from the repository root:

verificationshellscript
npm test
npm run test:e2e
npm run check
npm run build
npm run docs:build

The Playwright suite drives both acts through the real kill and restart endpoints. The Temporal integration suite interrupts Activity execution and verifies that a completed Child Workflow runs once.

Stop local services

After the demonstration, stop the Temporal container:

cleanupshellscript
npm run temporal:down