Skip to content

Recorded example

Resume a Workflow After a Worker Restart

Reproduce external worker recovery on Orch8 0.7.1. Save a checkpoint, terminate the worker, and verify that a replacement resumes the same task.

Run the worker interruption fixture

Use Node.js 20 or newer and the Orch8 Server 0.7.1 binary. Leave loopback ports 18087 and 15057 free. The verifier starts a disposable SQLite Engine and kills its own worker process while the Engine stays running.

Get the pinned Engine release
Bash
node verify-worker-interruption.mjs /path/to/orch8-server
Download the worker interruption verifier

Workflow definition

The verifier adds a fresh sequence ID, tenant, and creation timestamp when it registers these two steps.

first step

JSON
{
  "id": "first",
  "type": "step",
  "handler": "log",
  "params": {
    "message": "committed before worker interruption"
  }
}

external step

JSON
{
  "id": "external",
  "type": "step",
  "handler": "external_checkpoint_fixture"
}
Download the workflow definition

Can a replacement worker resume from a saved checkpoint?

In this recorded Orch8 0.7.1 run, a separate worker process claimed the second step, saved checkpoint 1, and was killed before completion. A replacement reclaimed the same task and finished from the saved checkpoint. The first output kept its original ID.

  1. First committed output observed +0 ms View first definition
  2. Original worker saved its checkpoint +61 ms View external definition
  3. Original worker process exited +63 ms View external definition
  4. Replacement acquired the task +3879 ms View external definition
  5. Completed workflow observed +4008 ms View external definition

The local fixture used a 3-second stale-heartbeat threshold and a one-second reaper tick. It performed no external provider calls. The observed timings include polling.

Download the recorded worker trace

Verify the technical details

The documentation is the source of truth for current behavior.

Read the documentation →