Cori
Reference

Run trace reference

Where run traces are written and the shape of the JSON trace file.

Location

Every workflow execution writes a JSON trace to:

~/.cori/runs/<run-key>/<utc-timestamp>.json

The run key encodes the workflow identity (path hash for local workflows, remote/<host>/<owner>/<repo>@<sha> for remote ones). The filename is the UTC timestamp of the run start in ISO 8601 format.

Reading traces

# List recent runs
cori runs list

# Show the full trace for a specific run
cori runs show <run-id>

Trace shape

{
  "run_id": "run_550e8400e29b41d4a716446655440000",
  "workflow_id": "translate-product-sheets-fr",
  "workflow_content_hash": "a1b2c3d4e5f6",
  "status": "completed",
  "trigger": "cli",
  "dry_run": false,
  "requesting_identity": "jean",
  "started_at": "2025-01-15T09:03:22.000Z",
  "ended_at": "2025-01-15T09:04:47.000Z",
  "duration_ms": 85000,
  "source": {
    "path": "./translate_product_sheets_fr"
  },
  "params": {
    "input_file": "products.csv",
    "spreadsheet_id": "1BxiM...",
    "dry_run": false
  },
  "activities": [
    {
      "activity_id": "activity-001",
      "step_name": "01_read_source_rows",
      "kind": "cli",
      "status": "completed",
      "started_at": "2025-01-15T09:03:23.000Z",
      "ended_at": "2025-01-15T09:03:24.500Z",
      "duration_ms": 1500,
      "attempts": 1,
      "route": null,
      "task_queue": "cori.user.john",
      "worker_identity": "Person",
      "input_summary": { },
      "output_summary": { },
      "output": { },
      "cost_eur": 0.0,
      "tokens": null,
      "error": null,
      "notes": null
    }
  ],
  "cost": {
    "total_eur": 0.15,
    "input_tokens": 2048,
    "output_tokens": 512
  },
  "error": null
}

Top-level RunTrace fields

FieldTypeDescription
run_idStringUnique run identifier (formatted as run_<uuid>), used with cori runs show
workflow_idStringValue of id from the manifest
workflow_content_hashString | null16-hex-char hash of the workflow folder contents at run time
statusStringcompleted or failed
triggerStringHow the run was initiated (typically cli)
dry_runBooleanWhether the run executed in dry-run mode
requesting_identityString | nullIdentity (user or pool name) of the machine/user that ran cori run
started_atISO 8601Run start time (UTC)
ended_atISO 8601Run end time (UTC)
duration_msNumberTotal elapsed time in milliseconds
sourceObject | nullOrigin of the workflow: { path } for local, extended for remote workflows (Phase 7+)
paramsObjectParameter values used for this run
activitiesArrayPer-step activity traces
costCostSummaryTotal LLM token costs and token usage
errorString | nullError message if the run failed, otherwise null

CostSummary object

FieldTypeDescription
total_eurNumberTotal cost in EUR for all LLM activities
input_tokensNumberTotal input tokens consumed across all LLM activities
output_tokensNumberTotal output tokens consumed across all LLM activities

ActivityTrace fields

FieldTypeDescription
activity_idStringUnique activity identifier within the run
step_nameStringStep filename without the .ts extension
kindStringActivity kind: cli, mcp_tool, code, or llm
statusStringcompleted or failed
started_atISO 8601Activity start time (UTC)
ended_atISO 8601Activity end time (UTC)
duration_msNumberElapsed time in milliseconds
attemptsNumberNumber of attempts made (retries + 1)
routeString | nullRoute hint if explicitly set by the step (usually null)
task_queueString | nullTemporal task queue the activity was dispatched to (Phase 7+, null for legacy traces)
worker_identityWorkerIdentity | nullType/identity of the worker that executed this activity (Phase 7+)
input_summaryObjectAbbreviated activity input for readability
output_summaryObjectAbbreviated activity output for readability
outputObjectComplete activity output (matches step's output Zod schema)
cost_eurNumber | nullCost of this activity in EUR (LLM activities only; null otherwise)
tokensTokenUsage | nullToken usage breakdown if applicable
errorString | nullError message if the activity failed, otherwise null
notesString | nullAdditional diagnostic notes, otherwise null

Key differences from documentation

When authoring workflows, keep these implementation details in mind:

  • Field naming: Use ended_at not completed_at; params not parameters; step_name not step
  • Remote workflows: The source field structure differs from workflow_ref; check actual runs for the current format
  • No top-level result: Workflow result is reconstructed from the final activity outputs; not a separate field
  • Phase 7 fields: task_queue and worker_identity are present in recent runs but null in legacy traces
  • Cost tracking: Only LLM activities populate cost_eur; CLI and code activities have null

On this page