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:
| Tier | Stages | Best for |
|---|---|---|
| Minimal | INTAKE → BUILD → DELIVER | Small teams, fast iteration, trusted codebases |
| Standard | + RESEARCH + REVIEW | Most production setups — balances speed and quality |
| Full | + FIX + TEST + LEARN | High-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 pipelineStep 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
doneStep 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:
- Log corrections — when agents get corrected, they write to a corrections file. This is the minimum viable learning loop.
- Promote patterns — after 3+ similar corrections, promote to permanent memory that loads at every session start.
- Share across agents — maintain a shared patterns file that all agents search before starting work.
- 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:
| Component | Purpose |
|---|---|
| Pipeline spec | Complete stage definitions, labels, and rules |
| Dispatch scripts | Main dispatch, fix dispatch, E2E dispatch |
| Session cleanup | Harvest completed sessions, prune worktrees |
| Pipeline control | Manual controls (disable, enable, retry, kill, reset) |
| Monitoring | Prompt detection, zombie detection, health reports |
| Label sync | Bidirectional label sync between issues and PRs |
| Agent prompts | Templates for research, build, fix, and test stages |
Common Pitfalls
| Pitfall | How to Avoid |
|---|---|
| Agents modifying the main branch | Always use worktrees. Never clone into the main repo directory. |
| Infinite fix loops | Circuit breaker after 3 attempts. No exceptions. |
| Zombie sessions consuming resources | Session cleanup cron 4x daily + zombie detection. |
| Stale worktrees filling disk | Auto-cleanup for merged/closed PRs in every dispatch cycle. |
| Agents waiting for input with no response | Prompt monitoring with auto-proceed after timeout. |
| Pipeline state drift | Labels are the source of truth. Daily reconciliation catches drift. |