Workflows
Workflows are YAML files in ~/.mur/workflows/ that define a sequence of steps for Commander to execute.
Format
id: deploy-docker
name: Deploy with Docker
description: Build and deploy a Docker container
variables:
image_name: "myapp"
tag: "latest"
steps:
- name: build
step_type: execute
action: "docker build -t {{image_name}}:{{tag}} ."
on_failure: abort
- name: deploy
step_type: execute
action: "docker compose up -d"
on_failure: abort
breakpoint: true
breakpoint_message: "About to deploy. Continue?"
- name: verify
step_type: execute
action: "curl -sf http://localhost:8080/health"
on_failure: retry
on_failure_max: 3
Variables
Use {{variable}} syntax. Set defaults in the workflow, override at runtime:
murc run deploy-docker --var image_name=api --var tag=v2.1
Step Types
| Type | Model Role | Use For |
|---|---|---|
execute | Shell | Run commands directly |
analyze | Thinking (Opus) | Deep analysis of errors/logs |
plan | Thinking (Opus) | Create action plans |
debug | Thinking (Opus) | Root cause analysis |
code | Coding (Sonnet) | Generate/fix code |
refactor | Coding (Sonnet) | Restructure code |
fix | Coding (Sonnet) | Apply fixes |
search | Task (Flash) | Search for information |
classify | Task (Flash) | Categorize data |
summarize | Task (Flash) | Summarize output |
security_check | Auditor (Ollama) | Security review |
Failure Handling
| Policy | Behavior |
|---|---|
abort | Stop the entire workflow |
skip | Log failure, continue to next step |
retry | Retry up to on_failure_max times |
auto_fix | AI analyzes error ā generates fix ā retries (Pro) |
Breakpoints
- name: dangerous-step
breakpoint: true
breakpoint_message: "About to delete old data. Confirm?"
In shadow mode, breakpoints are logged. In live mode, execution pauses until confirmed.
Shadow Mode
Preview what would happen without executing:
murc run deploy-docker --shadow
š® Shadow Execution Plan ā deploy-docker
3 steps total
ā
Step 1: build
[shadow] Would execute: docker build -t myapp:latest .
ā
Step 2: deploy
[shadow] Would execute: docker compose up -d
āø Breakpoint: About to deploy. Continue?
ā
Step 3: verify
[shadow] Would execute: curl -sf http://localhost:8080/health
Checkpoints
Commander saves a checkpoint before each step. If a workflow fails mid-execution, you can resume from the last checkpoint instead of starting over.
Checkpoints are stored in ~/.mur/commander/checkpoints/{execution_id}/.
Examples
Run Tests with Retry
id: run-tests
name: Run Tests
description: Run test suite with retry on failure
variables:
project_dir: "."
test_cmd: "cargo test"
steps:
- name: run-tests
step_type: execute
action: "cd {{project_dir}} && {{test_cmd}}"
on_failure: retry
on_failure_max: 2
Git Cleanup
id: git-cleanup
name: Git Cleanup
description: Clean up merged branches
variables:
main_branch: "main"
steps:
- name: fetch
step_type: execute
action: "git fetch --prune"
- name: delete-merged
step_type: execute
action: "git branch --merged {{main_branch}} | grep -v '\\*\\|{{main_branch}}' | xargs -r git branch -d"
breakpoint: true
breakpoint_message: "Delete merged branches?"
on_failure: skip
Fix NPM Dependencies
id: fix-npm-deps
name: Fix NPM Deps
description: Nuclear option for broken node_modules
steps:
- name: clean
step_type: execute
action: "rm -rf node_modules && npm cache clean --force"
- name: reinstall
step_type: execute
action: "npm install"
on_failure: retry
on_failure_max: 2
- name: verify
step_type: execute
action: "npm run build"