Step Dependencies
Explicit dependencies
Use depends_on to declare that a step must wait for another:
steps: - id: build run: "go build -o app ." - id: test run: "go test ./..." - id: deploy run: "scp app server:/opt/app" depends_on: "build"deploy waits for build to complete, while test runs independently.
Multiple dependencies
Pass a list to wait on several steps:
- id: release run: "gh release create v1.0.0" depends_on: - "build" - "test"release runs only after both build and test succeed.
Implicit variable edges
Pipe automatically detects when a step references another step’s output via $PIPE_* environment variables and creates a dependency edge:
steps: - id: get-version run: "git describe --tags --always" - id: build run: "docker build -t app:$PIPE_GET_VERSION ."Even without depends_on, Pipe sees that build references $PIPE_GET_VERSION (produced by get-version) and ensures get-version runs first.
Both $PIPE_FOO and ${PIPE_FOO} forms are detected.
How the DAG is built
- Each step registers the env vars it produces (
PIPE_<STEP_ID>, plusPIPE_<STEP_ID>_<SUBRUN_ID>for sub-runs). - Explicit
depends_onedges are added. - Implicit edges are added by scanning all
runcommands for$PIPE_*references and matching them to producing steps. - Duplicate edges are removed.
- The graph is checked for cycles using Kahn’s algorithm.
Cascade failure
When a step fails, all steps that depend on it (directly or transitively) are skipped. Pipe reports which steps were skipped and why.
Cycle detection
Pipe rejects pipelines with circular dependencies at parse time:
Error: dependency cycle detected among steps: build, test, deploySelf-dependencies are also caught:
Error: step "build": self-dependencyViewing the graph
Use pipe inspect <name> to see each step’s dependencies:
pipe inspect deployThe output shows each step with its depends_on relationships.