AI Agent Pipelines That Handle the Hard Parts

Wire agents into dependency chains with parallel execution, automatic handoffs, cycle detection, critical path analysis, and auto-retry on failure. Define the graph. chAIrman runs it.

depends_on: The Only Parameter You Need

Every pipeline in chAIrman starts with a single parameter: depends_on. When you assign a task, pass an array of agent IDs that must finish first. The task queues automatically with status waiting and launches the instant all dependencies reach done.

There is no pipeline definition file, no YAML config, no DAG builder. You express dependencies at task-assignment time, and the engine does the rest. This means pipelines are dynamic — you can extend them mid-execution by adding new agents that depend on running ones.

  • Sequential chains — Agent B depends on Agent A, Agent C depends on Agent B
  • Fan-out parallelism — Agents B, C, D all depend on Agent A, run in parallel after A finishes
  • Fan-in convergence — Agent E depends on Agents B, C, and D, waits for all three
  • Dynamic extension — Add new dependent agents while the pipeline is running
// Build a 3-stage pipeline // Stage 1: Database schema (runs immediately) assign_task({ agent_id: "db-agent", task: "Design the database schema" }) // Stage 2: API + Frontend (parallel, after DB) assign_task({ agent_id: "api-agent", task: "Build REST API endpoints", depends_on: ["db-agent"] }) assign_task({ agent_id: "ui-agent", task: "Build React components", depends_on: ["db-agent"] }) // Stage 3: QA (after both API + Frontend) assign_task({ agent_id: "qa-agent", task: "Run integration tests", depends_on: ["api-agent", "ui-agent"] })

Cycle Detection, Critical Path, and Auto-Retry

Production pipelines need more than execution. They need protection against deadlocks, visibility into bottlenecks, and automatic recovery from failures.

Cycle Detection

Before any dependency is added, detectCycleForNewDeps checks whether the new edge would create a circular dependency. If Agent A depends on B and B depends on A, the task is rejected immediately. No deadlocks, ever. The algorithm runs in real-time at assignment, not as a post-hoc validation.

Critical Path Analysis

computeCriticalPath calculates the longest chain through your pipeline, identifying which agents are on the critical path and which have slack. The pipeline status includes estimated completion time based on historical task durations. You know exactly where bottlenecks will form before they happen.

🔄

Auto-Retry on Failure

When an agent fails, chAIrman automatically replaces it, inherits the handoff notes, and re-assigns the same task. Up to three retries by default (configurable per agent). Eight stderr patterns are auto-detected — auth failure, rate limit, context exceeded — with specific recovery suggestions. Downstream agents stay queued, unaffected.

Topological Layers and Parallel Execution

chAIrman's pipeline engine uses computeLayers to decompose your dependency graph into topological layers. Agents in the same layer have no dependencies on each other and run in parallel. Agents in later layers wait for all their dependencies in earlier layers to complete.

This is not a simple queue. It is a proper graph scheduler that maximizes parallelism while respecting every dependency constraint. The getOptimalConcurrency function calculates how many agents can run simultaneously based on your CPU cores and available memory, so you never overload the system.

  • Layer 0 — No dependencies, all start immediately
  • Layer 1 — Depends only on Layer 0 agents, starts when Layer 0 finishes
  • Layer N — Depends on agents in layers 0 through N-1
  • Auto-launch — When an agent finishes, all unblocked waiting agents start automatically
// Pipeline visualization from the dashboard // Shows layers, status, and dependencies Pipeline: my-saas-app Layer 0 (running) db-agent [done] $0.12 Layer 1 (running) api-agent [working] $0.08... ui-agent [working] $0.06... Layer 2 (waiting) qa-agent [waiting] depends: api-agent, ui-agent Critical path: db-agent -> api-agent -> qa-agent Est. completion: ~12 min Total cost so far: $0.26

Context Flows Downstream

When an agent in a pipeline completes its task, it produces a structured handoff document — a markdown file and a JSON file containing completed tasks, files changed, blockers encountered, and recommendations for successor agents. This handoff is saved every 60 seconds during execution, so progress is never lost.

Downstream agents inherit this context. When a waiting agent's dependencies all reach done, it launches with full knowledge of what happened before it. Agents can also communicate through the message board: include [MSG:agent_id] in output to send a direct message to a specific agent, or [BROADCAST] to notify the entire team.

  • Structured handoff — JSON with completed tasks, files changed, blockers, and recommendations
  • Auto-save every 60s — No progress lost on crash or timeout
  • Message board — Agents post broadcasts or direct messages parsed from output
  • Alumni archive — Fired agents preserved with full history for future rehire
// Handoff document (auto-generated) { "role": "Database Engineer", "completedTasks": [ "Designed schema with 12 tables", "Added indexes for common queries", "Created migration files" ], "filesChanged": [ "src/db/schema.sql", "src/db/migrations/001.sql", "src/db/seed.ts" ], "recommendations": [ "API agent should use the User", " and Project tables first", "Add composite index on (user_id,", " project_id) for the tasks table" ] }

Real-Time Visibility Into Every Stage

Watch your pipeline execute on a live dashboard. Every agent, every stage, every dollar — visible in real-time over WebSocket.

💻

Live Dashboard

The dashboard at localhost:3456 shows a kanban board of all agents grouped by status. Click any agent to open a live terminal modal showing real-time activity — tool calls, text output, file writes, and permission requests. Pipeline dependencies are visualized as a graph.

🔔

Desktop Notifications

Native macOS notifications fire on task completion, budget warnings (80%+), and pipeline completion. Notifications are rate-limited and batched during bursts so they never flood your screen. You can keep working while the pipeline runs and get pinged when it matters.

📊

Pipeline Status API

getPipelineStatus returns stage counts, active/waiting/done per layer, critical path, blocked agents, and estimated completion time. getPipelineGraph generates the full dependency graph. Both available via MCP tools and REST API. Subscribe to webhook events for external integrations.

Pipeline Questions

How many agents can run in a pipeline simultaneously?
The default maximum is 10 concurrent agents, configurable via CHAIRMAN_MAX_AGENTS or .chairmanrc.json. The getOptimalConcurrency function calculates the recommended number based on your CPU cores and available memory. On a modern laptop, 5-8 parallel agents is typical without performance degradation.
What happens if one agent in a pipeline fails and cannot be retried?
If an agent exhausts all retries, it enters the error state. All downstream agents that depend on it remain in waiting status indefinitely. You can then either replace_agent to give it a fresh start with the original handoff notes, or restructure the pipeline by reassigning the downstream tasks with different dependencies. The get_queue tool shows all blocked agents and what they are waiting on.
Can I add new agents to a running pipeline?
Yes. Pipelines are dynamic. You can hire a new agent and assign it a task with depends_on pointing to agents that are already running or already done. If the dependencies are already complete, the new agent starts immediately. If not, it queues and waits. This lets you extend pipelines based on intermediate results.
How do agents share work products between pipeline stages?
Agents work in the same project directory. When a Stage 1 agent writes files — database schemas, API routes, component scaffolds — Stage 2 agents can read those files directly. In addition, each agent produces structured handoff documents (JSON + markdown) that capture what was done, which files were changed, and recommendations for the next stage. These handoffs are passed to downstream agents via the prompt.
Does chAIrman support conditional branching in pipelines?
Not natively. The pipeline engine is a dependency graph, not a workflow engine with conditionals. However, you can implement conditional logic as the CEO (the orchestrating Claude instance) by checking agent output before assigning the next task. For example, if a QA agent's output says tests failed, you can hire a fix agent instead of proceeding to deployment. The dynamic pipeline extension makes this straightforward.

Ready to orchestrate your AI workforce?

Join developers who ship faster with chAIrman. From $19.99/mo.