Automate reproducible workflows
Crab executes declared stages from repository files and caches outputs by input identity. Use this section for command-focused explanations of stages, dependency graphs, parameters, metrics, experiments, and queues.
A stage becomes reusable evidence
Scroll horizontally to explore the full diagram →
Start with one cached command
Create a stage in crab.yaml, then run its output target:
stages:
train:
cmd: python scripts/train.py
deps:
- scripts/train.py
- data/training.parquet
outs:
- models/model.safetensorscrab run models/model.safetensors
crab run models/model.safetensorsThe first run executes the command and records the successful output state. The second run can replay a matching cache entry when every declared input still identifies the same content.
Change one declared dependency and use a dry run to inspect why the stage no longer matches its previous result:
touch data/training.parquet
crab run train --dry-run --explain-missThe plan should identify the changed dependency. This is the central workflow debugging rule: inspect the computed identity before forcing execution or deleting cache data.
Separate declarations from runtime state
Commit workflow declarations, parameter files, and lockfiles to Git. Keep run journals, temporary worktrees, and local cache entries under .crab/.
| State | Purpose | Normal owner |
|---|---|---|
crab.yaml | Declares commands, dependencies, and outputs | Git |
crab.lock | Records the successful stage state | Git |
| Stage cache | Stores reusable output snapshots | Local or Crab remote |
| Run journal | Records execution and recovery progress | Local client |
| Experiment ref | Identifies a retained experiment result | Git and Crab remote |
Choose the next topic
- Run commands and understand cache decisions
- Define workflow pipelines with ordered dependencies
- Inspect the workflow journal after interruption or retry
- Understand the workflow lockfile that records successful state
- Track experiments and compare parameter changes
- Queue experiments for batch execution
- Define parameters and matrix overrides
- Track metrics for comparisons
- Visualize the dependency graph before execution
For an end-to-end learning path, start with the Workflow quickstart. Use the CLI reference when you already know the command and need its flags.