LoopFlow
Tutorial Workshop Keywords ๐ŸŽฎ LoopFlow Lab
Keywords / pipeline

pipeline

Stages in order; fail-fast. Compose

Syntax

pipeline "<name>":
  stage <name>: โ€ฆ

What it does

Sequences stages and runs them in order โ€” each stage runs only if the one before it passed, and a failing stage halts the rest (fail-fast). Every stage's body is a loop: it has its own goal, its own done when, and its own back-edge, so the pipeline is really a chain of self-correcting loops with a shared thread of progress. The natural mapping is the reason it exists: an epic โ†’ a pipeline, each story โ†’ a stage. When a job is too big to verify with a single check, you don't write one giant loop โ€” you break it into ordered stories, each with a check it can pass on its own.

Reach for a pipeline when the work has real ordering constraints: a security scan must pass before you build, the build must be green before a human approves the UI, the deploy runs last. Fail-fast keeps a broken early stage from wasting cycles on everything downstream, and per-stage human gates (a human approves before โ€ฆ) let you put a hard stop in front of the risky steps only. A pipeline needs at least one stage; the pipeline keyword sits at column 0 and each stage is indented under it with its own body indented again. For unordered work that can run at once, an inner stages in parallel: block runs its stages concurrently instead.

Example

pipeline "ship feature":
  stage security:
    goal: no high or critical vulnerabilities
    done when "semgrep --severity=high" finds nothing
  stage build:
    a human approves the plan first
    goal: feature works and tests pass
    done when "pnpm test" passes
examples/ship_feature.loop (abridged)

How it runs

securitysemgrep โœ“ ๐Ÿ‘ค gatebuildpnpm test โœ“ ๐Ÿ‘ค gateuihuman review ๐Ÿ‘ค gatedeployhealth.sh โœ“ each stage runs only if the one before passed โ€” โœ— a failure halts the rest
An epic โ†’ a pipeline, each story โ†’ a stage; stages run in order with their own checks and gates.

Example โ€” a gated deploy at the end

pipeline "epic: checkout v2":

  stage "story: cart totals":
    goal: cart shows correct totals with tax
    look at: src/cart/, src/tax/
    done when "pnpm test cart" passes

  stage "story: checkout submit":
    a human approves before charging the card
    goal: order submits and payment is captured
    done when "pnpm test checkout" passes
stories in order, a gate before the risky one

Common mistakes

Related