wololo
Get access

Building Your Own Pipeline

The pipeline pattern is designed to be replicable. You don't need our exact setup — you need the principles and a way to wire them together. This page walks you through building a continuous agent engineering pipeline from scratch.

Prerequisites

  • A gateway running (OpenClaw, NanoClaw, or IronClaw — OpenClaw recommended)
  • At least one coding agent configured (Claude Code, Codex, or similar)
  • A GitHub repository with a project board
  • Cron scheduling (gateway-native or system cron)

Step 1: Define Your Stages

Start with the minimum viable pipeline and add stages as needed:

Choose a complexity level based on your team's needs:

TierStagesBest for
MinimalINTAKE → BUILD → DELIVERSmall teams, fast iteration, trusted codebases
Standard+ RESEARCH + REVIEWMost production setups — balances speed and quality
Full+ FIX + TEST + LEARNHigh-quality requirements, self-improving over time

Step 2: Define Your Labels

Labels encode pipeline state. Design them so any engineer can read the current state at a glance. Use a consistent prefix to group pipeline labels.

Recommended label scheme:

Classification:
  agent              — automatable by agent
  human              — needs human judgment
  needs-info         — missing information

Stage tracking:
  pipeline:research-done
  pipeline:review-requested
  pipeline:review-done
  pipeline:comments-fixed
  pipeline:e2e-passed
  pipeline:e2e-failed

Control:
  agent-stuck        — circuit breaker tripped
  parked             — human paused the pipeline

Step 3: Create Your Dispatch Script

The dispatch script is the engine. It runs on a schedule, queries GitHub for work, and spawns agents. Here's the skeleton:

#!/bin/bash
# pipeline-dispatch.sh — run via cron every 15 minutes

REPO="your-org/your-repo"
PROJECT_NUM=1
MAX_CONCURRENT=2

# 1. Find work
issues=$(gh issue list --repo $REPO --label "agent" \
  --json number,labels --jq '
  [.[] | select(
    (.labels | map(.name) | contains(["pipeline:research-done"])) and
    (.labels | map(.name) | contains(["agent-stuck"]) | not)
  )]')

# 2. Check concurrency
active=$(tmux ls 2>/dev/null | grep -c "^cc-issue-")
available=$((MAX_CONCURRENT - active))

# 3. Spawn agents for eligible issues
echo "$issues" | jq -r '.[0:'"$available"'] | .[].number' | while read num; do
  WORKTREE="$HOME/worktrees/issue-$num"

  # Create isolated worktree
  cd ~/your-repo
  git fetch origin main
  git worktree add -b "fix/issue-$num" "$WORKTREE" origin/main

  # Spawn coding agent
  tmux new-session -d -s "cc-issue-$num" -c "$WORKTREE" \
    "claude --dangerously-skip-permissions"

  # Send task to agent
  tmux send-keys -t "cc-issue-$num" \
    "Fix GitHub issue #$num. Create a PR with 'Closes #$num'." Enter
done

# 4. Cleanup merged worktrees
git worktree list --porcelain | grep "worktree " | \
  while read _ path; do
    branch=$(git -C "$path" branch --show-current 2>/dev/null)
    # Check if PR is merged, if so remove worktree
  done

Step 4: Set Up Cron Jobs

Wire your dispatch script to the gateway's cron system:

# Gateway cron (openclaw.json)
{
  "cron": {
    "jobs": [
      {
        "name": "pipeline-dispatch",
        "schedule": "*/15 * * * *",
        "session": "isolated",
        "message": "Run pipeline dispatch cycle",
        "wake": "now"
      }
    ]
  }
}

Step 5: Add Quality Gates

Start with CI as your only gate, then add more as you gain confidence:

Level 1: CI only

  • PR must pass CI before merge
  • No automated review — human reviews everything

Level 2: CI + automated review

  • Add a GitHub Action for code review
  • Fix agent addresses review comments automatically
  • Human still approves merge

Level 3: Full gates

  • Automated review + fix cycle
  • Security gate for sensitive surfaces
  • E2E testing with browser automation
  • Auto-merge for low-risk repos

Step 6: Add the Learning Loop

The learning loop is what makes the pipeline improve over time. Start simple:

  1. Log corrections — when agents get corrected, they write to a corrections file. This is the minimum viable learning loop.
  2. Promote patterns — after 3+ similar corrections, promote to permanent memory that loads at every session start.
  3. Share across agents — maintain a shared patterns file that all agents search before starting work.
  4. Measure improvement — track fix cycle count, stuck rate, and time-to-PR to verify the loop is working.

Step 7: Add Circuit Breakers

Without circuit breakers, a stuck agent will burn compute forever. Add these safeguards:

  • Max fix attempts — after N attempts (recommend 3), stop and flag for human
  • Session timeout — kill agents that run longer than the expected maximum
  • Zombie detection — kill sessions with no output after a threshold
  • Global disable — a kill switch that pauses all pipeline processing

Reference Implementation

The Wololo platform ships with a reference implementation of this pipeline pattern. It includes all stages, quality gates, learning loops, and monitoring. Key components:

ComponentPurpose
Pipeline specComplete stage definitions, labels, and rules
Dispatch scriptsMain dispatch, fix dispatch, E2E dispatch
Session cleanupHarvest completed sessions, prune worktrees
Pipeline controlManual controls (disable, enable, retry, kill, reset)
MonitoringPrompt detection, zombie detection, health reports
Label syncBidirectional label sync between issues and PRs
Agent promptsTemplates for research, build, fix, and test stages

Common Pitfalls

PitfallHow to Avoid
Agents modifying the main branchAlways use worktrees. Never clone into the main repo directory.
Infinite fix loopsCircuit breaker after 3 attempts. No exceptions.
Zombie sessions consuming resourcesSession cleanup cron 4x daily + zombie detection.
Stale worktrees filling diskAuto-cleanup for merged/closed PRs in every dispatch cycle.
Agents waiting for input with no responsePrompt monitoring with auto-proceed after timeout.
Pipeline state driftLabels are the source of truth. Daily reconciliation catches drift.