Examples / first run

Available

Run a command-only workflow

Install the matched 0.23.1 bundle, save a complete local command graph, then create, validate, start and inspect a run.

Last reviewed 2026-11-10.

Install the matched bundle

Use Python 3.12 or newer in a fresh directory. The example uses python3.12. Replace it with your chosen Python 3.12+ executable if needed. These commands use a POSIX shell and need no model provider:

python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install "millrace==0.23.1"
mkdir workflow project

The bundle pins Core, Plus and OS to 0.23.1. This first workflow uses only Core. It needs no Plus template and no OS service. To install Core alone on Python 3.11+, use millrace-ai==0.23.1 instead.

Save and run the graph

The graph and Core commands below match the tagged 0.23.1 getting-started guide.

Copy the complete graph below and save it as workflow/workflow.json. The install step created the workflow/ and project/ folders. The graph has one step. That step runs a Python command that prints a DONE result, and the graph then finishes the run.

{
  "format": "millrace-router/v3",
  "limits": {"max_invocations": 2, "max_elapsed_seconds": 60},
  "bindings": {
    "python": {"adapter": "command", "contract": "millrace-command/v1", "executable": "python3", "config": {}}
  },
  "control_files": [],
  "defaults": {"timeout_seconds": 30},
  "planes": {
    "main": {
      "workspace": ".", "start": "step",
      "nodes": {
        "step": {
          "invoke": {"binding": "python", "config": {"args": ["-c", "print('{\"outcome\":\"DONE\",\"summary\":\"Command completed\",\"refs\":[]}')"]}},
          "result": "json-v1", "outcomes": ["DONE"],
          "on": {"DONE": {"finish": "succeeded"}},
          "on_error": {"pause": {"reason": "execution_error", "resume": "step"}},
          "on_unknown": {"pause": {"reason": "unknown", "resume": "step"}}
        }
      }
    }
  }
}

Create an instance using a fresh state home:

millrace router instance create \
  --state-home ./router-state \
  --workflow ./workflow/workflow.json \
  --project ./project

Replace INSTANCE with the returned instance_id. Validate and start the instance:

millrace router validate \
  --state-home ./router-state --instance INSTANCE
millrace router start \
  --state-home ./router-state --instance INSTANCE

Replace RUN with the returned run_id, then inspect the run:

millrace router status \
  --state-home ./router-state \
  --instance INSTANCE --run RUN

Commands that change state print a request envelope before their result. Keep the envelope so you can replay the exact request if you cannot tell whether it arrived. The start command can stay in the foreground until work pauses or finishes. The first stop signal lets active work finish, then pauses. A second stop signal requests cancellation. Use public controls for exact request replay, edits and recovery.

Continue with two headless instances

The Plus command-only quickstart demonstrates two instances, edits and expansion through OS. That walkthrough's native daemon stop step requires macOS. Native templates need their separately configured harness.

Historical record: 0.22.2 Simple Loop receipt

The 0.22.2 Simple Loop receipt remains historical evidence. It records one ready work item before dispatch in the former runtime. It does not demonstrate the 0.23 router or qualify current native adapters.

Version 0.23 uses a different graph and state format. Reauthor old workflows and use fresh state.