Fleet 1.13 is herePipeline orchestration, Brain daemon, and 136 agent templates.Read the release notes →
Fleet

Pipelines

Pipelines orchestrate multi-stage workflows across your agent fleet. Each stage can involve one or more agents, with automatic progression, approval gates, and failure recovery.

Configuration

Pipelines are defined in your .fleet/config.yaml alongside agent definitions:

pipelines:
  - name: deploy
    description: "Full deployment pipeline"
    stages:
      - name: develop
        agents:
          - frontend-dev
          - backend-dev
        parallel: true

      - name: review
        agents:
          - tech-lead
          - qa-lead
        parallel: true
        approval_required: true

      - name: ship
        agents:
          - release-manager
        approval_required: false

  - name: hotfix
    description: "Emergency hotfix pipeline"
    stages:
      - name: fix
        agents:
          - backend-dev
      - name: review
        agents:
          - tech-lead
        approval_required: true
      - name: ship
        agents:
          - release-manager

Stage fields

FieldTypeDescription
namestringStage identifier
agents[]stringAgent names assigned to this stage
parallelboolRun agents in parallel (default: false, sequential)
approval_requiredboolRequire all agents to approve before advancing

Stage Lifecycle

Each pipeline run progresses through stages. Here is the state machine for a single stage:

                                                 ┌─────────────────────────────────────────────┐
                                                 │ PENDING  │
                                                 └─────────────────────────────────────────────┘
                                                        │ run starts / agents launched
                                                        ▼
┌─────────────────────────────────────────────┐
│PENDING  │
└─────────────────────────────────────────────┘
  │ run starts / agents launched
  ▼
┌─────────────────────────────────────────────┐
│ RUNNING  │◀─────────────────────────────────┐
│          │  signal / eval   │  retry         │
│          │     ▼                         │
│          │  APPROVAL GATE  (rejected ↦ reroute)
│          │     ▼           ▼
│          └─────────────────────────────────────────────┐
│          │  approved
│          │     ▼
│          └─────────────────────────────────────────────┐
│ COMPLETE  │
│          └─────────────────────────────────────────────┐
│          │
│ FAILED │ (dead session detected)
└─────────────────────────────────────────────┘

PENDING

Initial state. The stage is waiting for the previous stage to complete before agents are launched.

RUNNING

Agents have been started in tmux sessions. The sweep loop monitors their progress.

APPROVAL GATE

All agents have signaled completion. If approval_required is true, the system waits for approval/rejection.

COMPLETE

The stage has finished successfully. The next stage's agents are launched.

FAILED

A dead session was detected or an unrecoverable error occurred. Retries may be attempted.

Approval Gates

When approval_required: true is set on a stage, all assigned agents must complete and approve before the pipeline advances. This is how code review stages work:

Approval flow

  1. Pipeline reaches an approval stage
  2. All assigned agents (e.g., tech-lead, qa-lead) are started
  3. Each agent reviews, then signals completion via fleet pipeline signal or the FLEET_SIGNAL_CMD env var
  4. The agent publishes a decision event (pr_approved or pr_changes_requested)
  5. If all agents approve, the pipeline advances to the next stage
  6. If any agent rejects, the pipeline routes back to the appropriate stage for fixes

Rejection routing

When an agent rejects at an approval gate, the pipeline engine routes the run back to the development stage. The original agents are restarted with the review feedback included in their task context. This creates a natural review-fix-review loop without manual intervention.

Sweep Loop

The pipeline engine runs a sweep loop that processes all active runs. You can target a specific run or sweep everything:

// Sweep all active runs
pipeline.Sweep()

// Advance a specific run
pipeline.AdvanceRun(runID)

What sweep does on each tick

  1. Checks each active run for completed signals
  2. Detects dead tmux sessions (agents that crashed)
  3. Processes approval gates (checks all agents approved)
  4. Advances to the next stage when the current stage is complete
  5. Starts agents for newly-active stages
  6. Marks runs as complete when all stages finish

Dead Session Detection

Agent status is determined at runtime by checking tmux.HasSession(). If an agent's tmux session disappears during a pipeline run, the sweep loop detects it and can:

Retry

Restart the agent and reassign the task

Fail

Mark the stage as failed and stop the pipeline

Skip

Continue to the next stage if the dead agent is not critical

CLI Usage

Start a pipeline run

fleet pipeline run deploy --title "Release v1.13"

Signal stage completion

fleet pipeline signal --run 42 --agent tech-lead

Watch a run live

fleet pipeline watch 42