Cori
Concepts

Execution model

What cori run actually does — from folder resolution to the JSON trace written at the end.

When you run cori run ./translate_product_sheets_fr, here's what happens:

1. Resolve the folder

If you pass a local path, Cori reads from it directly. If you pass a git ref (e.g. github.com/org/workflows/translate@v1.1.12), Cori fetches and caches it in ~/.cori/cache/remote/. First-run remote refs require your consent unless --yes is passed.

2. Compile to the cache

Cori reads the manifest and step files, validates the workflow structure, and compiles the TypeScript steps to ~/.cori/cache/. This is what cori check does without executing.

3. Plan: assign steps to task queues

Each step is assigned to a Temporal task queue derived from the worker identity that can execute it. In the default single-worker setup, all steps go to your machine's queue.

4. Start Temporal (if needed)

If no Temporal endpoint is configured and nothing is serving 127.0.0.1:7233, cori run shells out to temporal server start-dev as a supervised child process. For production, you point Cori at an existing Temporal cluster via config. See Configure Temporal.

TODO: Confirm whether the temporal binary is bundled with the Cori CLI installer or must be installed separately.

5. Start the Temporal workflow

Cori starts a single CoriWorkflow on Temporal. Temporal handles durability: if your machine crashes mid-run, restarting Cori replays from the last checkpoint.

6. Dispatch steps as activities

Each step in the workflow runs as a Temporal activity on the assigned task queue. The worker picks it up, executes it (running the shell command, calling the MCP tool, running the TypeScript code, or calling the LLM), and returns the output.

Steps run sequentially by default. Parameters flow from step output to step input via typed Zod schemas.

7. Write the trace

When the workflow completes, Cori writes a JSON trace to ~/.cori/runs/<key>/<utc>.json. The trace records the requesting identity, per-step task queues and worker identities, timings, and outputs. See Run trace.

Inspecting runs

cori runs list              # list recent runs
cori runs show <run-id>     # full trace for a run
cori show ./my_workflow     # workflow metadata + recent runs
cori status                 # endpoint, identity, online workers

On this page