# Conductor A CLI tool for defining and running multi-agent workflows with the GitHub Copilot SDK and Anthropic Claude. [![CI](https://github.com/microsoft/conductor/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/conductor/actions/workflows/ci.yml) [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/) ## Why Conductor? A single LLM prompt can answer a question, but it can't review its own work, research from multiple angles, or pause for human approval. You need multi-agent workflows—but building them means coding custom solutions, managing state, handling failures, and hoping you don't create infinite loops. Conductor provides the patterns that work: evaluator-optimizer loops for iterative refinement, parallel execution with failure modes, and human-in-the-loop gates. Define them in YAML with built-in safety limits. Version control your workflows like code. ## Features - **YAML-based workflows** - Define multi-agent workflows in readable YAML - **Multiple providers** - GitHub Copilot or Anthropic Claude with seamless switching - **Parallel execution** - Run agents concurrently (static groups or dynamic for-each) - **Sub-workflow composition** - Reusable sub-workflows with templated `input_mapping`, usable inside `for_each` groups for dynamic fan-out - **Script steps** - Run shell commands and route on exit code or parsed JSON stdout - **Dialog mode** - Agents can pause for multi-turn conversation when uncertain - **Reasoning effort** - Unified `reasoning.effort` (low/medium/high/xhigh) per agent or workflow-wide, translated to each provider's native API - **Workspace instructions** - Auto-discover and inject `AGENTS.md` / `CLAUDE.md` / `.github/copilot-instructions.md` into every agent's prompt - **Conditional routing** - Route between agents based on output conditions - **Human-in-the-loop** - Pause for human decisions with Markdown-rendered prompts and clickable file links - **Safety limits** - Max iterations and timeout enforcement - **[Web dashboard](#web-dashboard)** - Real-time workflow visualization with interactive DAG graph, breadcrumb navigation into sub-workflows, live streaming, and in-browser human gates - **Validation** - Catches stale template references, missing inputs, and undeclared dependencies before runtime ## Installation ### Quick Install (Recommended) **macOS / Linux:** ```bash curl -sSfL https://aka.ms/conductor/install.sh | sh ``` **Windows (PowerShell):** ```powershell irm https://aka.ms/conductor/install.ps1 | iex ``` The installer checks for [uv](https://docs.astral.sh/uv/) (installs it if missing), fetches the latest release with pinned dependencies, and verifies integrity via SHA-256 checksum. ### Updating ```bash conductor update ``` ### Manual Install ```bash # Install from GitHub uv tool install git+https://github.com/microsoft/conductor.git # Run the CLI conductor run workflow.yaml # Or run directly without installing uvx --from git+https://github.com/microsoft/conductor.git conductor run workflow.yaml # Install a specific branch, tag, or commit uv tool install git+https://github.com/microsoft/conductor.git@branch-name uv tool install git+https://github.com/microsoft/conductor.git@v1.0.0 uv tool install git+https://github.com/microsoft/conductor.git@abc1234 ``` ### Using pipx ```bash pipx install git+https://github.com/microsoft/conductor.git conductor run workflow.yaml # Install a specific branch or tag pipx install git+https://github.com/microsoft/conductor.git@branch-name ``` ### Using pip ```bash pip install git+https://github.com/microsoft/conductor.git conductor run workflow.yaml # Install a specific tag or commit pip install git+https://github.com/microsoft/conductor.git@v1.0.0 ``` ## Quick Start ### 1. Create a workflow file ```yaml # my-workflow.yaml workflow: name: simple-qa description: A simple question-answering workflow entry_point: answerer agents: - name: answerer model: gpt-5.2 prompt: | Answer the following question: {{ workflow.input.question }} output: answer: type: string routes: - to: $end output: answer: "{{ answerer.output.answer }}" ``` ### 2. Run the workflow ```bash conductor run my-workflow.yaml --input question="What is Python?" ``` ### 3. View the output ```json { "answer": "Python is a high-level, interpreted programming language..." } ``` ## Web Dashboard Conductor includes a built-in real-time web dashboard that lets you visualize and interact with your workflows as they run. Launch it with `--web`: ```bash conductor run workflow.yaml --web --input question="What is Python?" ``` ![Web Dashboard](docs/img/web-dashboard.png) **Key features:** - **Interactive DAG graph** — Zoomable, draggable workflow graph with animated edges showing execution flow and conditional routing - **Live agent streaming** — Watch agent reasoning, tool calls, and outputs stream in real-time as each step executes - **Three-pane layout** — Resizable panels for the graph, agent detail, and a tabbed output pane (Log, Activity, Output) - **In-browser human gates** — Respond to human-in-the-loop decision points directly in the dashboard, no terminal needed - **Per-node detail** — Click any node to see its prompt, metadata (model, tokens, cost), activity stream, and output - **Background mode** — Run with `--web-bg` to start the dashboard in the background, print the URL, and exit. Use `conductor stop` to shut it down later. ```bash # Run in background — prints dashboard URL and exits conductor run workflow.yaml --web-bg --input topic="AI in healthcare" # Stop a background workflow conductor stop ``` ## Providers Conductor supports multiple AI providers. Choose based on your needs: | Feature | Copilot | Claude | |---------|---------|--------| | **Pricing** | Subscription ($10-39/mo) | Pay-per-token | | **Context Window** | 8K-128K tokens | 200K tokens | | **Tool Support (MCP)** | Yes | Planned | | **Streaming** | Yes | Planned | | **Best For** | Heavy usage, tools | Large context, pay-per-use | ### Using Claude ```yaml workflow: runtime: provider: claude default_model: claude-sonnet-4.5 ``` Set your API key: `export ANTHROPIC_API_KEY=sk-ant-...` **See also:** [Claude Documentation](docs/providers/claude.md) | [Provider Comparison](docs/providers/comparison.md) | [Migration Guide](docs/providers/migration.md) ## CLI Reference ### `conductor run` Execute a workflow from a YAML file. ```bash conductor run [OPTIONS] ``` | Option | Description | |--------|-------------| | `-i, --input NAME=VALUE` | Workflow input (repeatable) | | `-m, --metadata KEY=VALUE` | Workflow metadata (repeatable; surfaced in `workflow_started`) | | `--workspace-instructions` | Auto-discover `AGENTS.md` / `CLAUDE.md` / `.github/copilot-instructions.md` and prepend to every agent prompt | | `--instructions PATH` | Explicit instructions file (repeatable) | | `-p, --provider PROVIDER` | Override provider | | `--dry-run` | Preview execution plan | | `--skip-gates` | Auto-select at human gates | | `--web` | Start real-time web dashboard | | `--web-bg` | Run in background, print dashboard URL, exit | | `--web-port PORT` | Port for web dashboard (0 = auto) | | `-q, --quiet` | Suppress progress output | | `-s, --silent` | Suppress all output except errors | | `-l, --log-file PATH` | Write logs to file | ### `conductor validate` Validate a workflow file without executing. ```bash conductor validate ``` **Full CLI documentation:** [docs/cli-reference.md](docs/cli-reference.md) ## Workflow Registries Conductor supports named workflow registries — GitHub repos or local directories containing shared workflows. Configure a registry once, then run workflows by short name. ### Quick start ```bash # Add a registry conductor registry add official myorg/conductor-workflows --default # List available workflows conductor registry list official # Run a workflow from the registry conductor run qa-bot # latest from default registry conductor run 'qa-bot@official#v1.2.3' # specific tag (quote the #) conductor run 'qa-bot@official#main' # branch HEAD (re-resolved on fetch) ``` See [docs/design/registry.md](docs/design/registry.md) for the full design. ## Examples See the [`examples/`](./examples/) directory for complete workflows: | Example | Description | |---------|-------------| | [simple-qa.yaml](./examples/simple-qa.yaml) | Basic single-agent Q&A | | [for-each-simple.yaml](./examples/for-each-simple.yaml) | Dynamic parallel processing | | [parallel-research.yaml](./examples/parallel-research.yaml) | Static parallel execution | | [design-review.yaml](./examples/design-review.yaml) | Human gate with loop pattern | | [script-step.yaml](./examples/script-step.yaml) | Script step with exit_code routing | **More examples and running instructions:** [examples/README.md](./examples/README.md) ## Documentation | Document | Description | |----------|-------------| | [Workflow Syntax](./docs/workflow-syntax.md) | Complete YAML schema reference | | [CLI Reference](./docs/cli-reference.md) | Full command-line documentation | | [Parallel Execution](./docs/parallel-execution.md) | Static parallel groups | | [Dynamic Parallel](./docs/dynamic-parallel.md) | For-each groups and array processing | | [Claude Provider](./docs/providers/claude.md) | Claude setup and configuration | | [Provider Comparison](./docs/providers/comparison.md) | Copilot vs Claude decision guide | ## Development ### Prerequisites - Python 3.12+ - [uv](https://github.com/astral-sh/uv) for dependency management ### Setup ```bash git clone https://github.com/microsoft/conductor.git cd conductor make dev ``` ### Windows On Windows, use `uv` directly instead of `make`: ```powershell uv sync --all-extras # instead of make dev uv run pytest tests/ # instead of make test uv run ruff check . # instead of make lint uv run ruff format . # instead of make format ``` **Copilot CLI path:** Windows `subprocess` cannot resolve `.bat`/`.ps1` wrappers by name alone. If you see `[WinError 2] The system cannot find the file specified` when running workflows, set the full path to the Copilot CLI: ```powershell # Find your copilot CLI Get-Command copilot* | Format-Table Name, Source # Set the path (use the .cmd variant from npm) $env:COPILOT_CLI_PATH = "C:\Users\\AppData\Roaming\npm\copilot.cmd" ``` ### Common Commands ```bash make test # Run tests make test-cov # Run tests with coverage make lint # Check linting make format # Auto-fix and format code make typecheck # Type check make check # Run all checks (lint + typecheck) make validate-examples # Validate all example workflows ``` ### Code Style - [Ruff](https://github.com/astral-sh/ruff) for linting and formatting - [ty](https://github.com/astral-sh/ty) for type checking - Google-style docstrings ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [Contributor License Agreements](https://cla.opensource.microsoft.com). When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. To submit a pull request, follow these steps: 1. Fork the repository 2. Create a feature branch (`git checkout -b feature/amazing-feature`) 3. Make your changes 4. Run tests and checks (`make test && make check`) 5. Commit your changes (`git commit -m 'Add amazing feature'`) 6. Push to the branch (`git push origin feature/amazing-feature`) 7. Open a Pull Request ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. ## License MIT License - see [LICENSE](./LICENSE) for details.