Skip to Content
WorkflowsCreate a Workflow

Create a Workflow

Workflows allow you to automate multi-step development tasks across branches and worktrees simultaneously. Configure ordered command sequences once and execute them whenever needed without opening separate terminal windows.


How to Create a Workflow

Open the Workflow Drawer

In the Workflows view, select the Add Workflow button in the top toolbar, or press the keyboard shortcut:

  • Shortcut: Shift + A

Enter Name and Commands

The Add Workflow drawer slides open from the right:

  • Name: Enter a clear, purpose-based name (e.g. Quality Checks, Setup New Worktree, Full Build).
  • Command: Enter the first shell command to execute.
  • Select Add Command to append additional steps. Commands execute strictly from top to bottom in the order defined.

A workflow configured with test and lint commands

Save the Workflow

Select Save. WorktreeWise validates the commands and writes the definition to .git/WorktreeWise/<name>/details.json. The workflow appears immediately in your Saved Workflows table.


Command Ordering & Fail-Fast Execution

Within each target worktree, workflows execute commands sequentially:

  1. Step 1 runs in the worktree root directory (cwd).
  2. If Step 1 exits with code 0 (success), Step 2 begins immediately.
  3. If any step fails (non-zero exit code), execution stops immediately for that worktree, and the failure is highlighted in the live Log panel.

Common Workflow Examples

Modern Web Application (Node.js / TypeScript)

  • Name: Verify Pull Request
  • Commands:
    1. npm ci
    2. npm run lint
    3. npm run test -- --ci
    4. npm run build

Full-Stack Database Workflow

  • Name: Reset & Seed Database
  • Commands:
    1. npx prisma migrate reset --force
    2. npx prisma db seed
    3. npm test

Rust Project

  • Name: Cargo Check & Test
  • Commands:
    1. cargo check --all-targets
    2. cargo clippy -- -D warnings
    3. cargo test

Python Project

  • Name: Pytest & Typecheck
  • Commands:
    1. poetry install --no-root
    2. ruff check .
    3. mypy src
    4. pytest

Running the Workflow

Once created:

  1. Locate the workflow in the Saved Workflows table.
  2. Choose Sequential or Parallel execution mode.
  3. Select target worktrees in the dropdown.
  4. Select the green Play (▶) button. For details, see Run a Workflow.