Skip to content
Latchkey

What Is a Pipeline Step? The Smallest Unit of Work

A pipeline step is the smallest unit of work in a pipeline: one command or one reusable action that runs inside a job.

If a job is a recipe, steps are the individual instructions. Each step does one thing: check out the repository, install dependencies, run the test suite, or upload an artifact. Steps run in order within a job and share the same machine and workspace, so a later step can use files an earlier step produced.

What a step does

A step is either a shell command you write (run: npm test) or a packaged action you reuse (uses: actions/checkout). Steps execute top to bottom, and by default if one step fails the rest of the job stops.

Steps share a workspace

All steps in a job run on the same runner and see the same filesystem. That is why a "checkout" step followed by a "build" step works: the second step finds the files the first one cloned. State does not carry between jobs unless you pass it explicitly.

A quick example

A minimal job has steps like: check out the repo, set up the language toolchain, install dependencies, run tests. In YAML each item under steps: is one step, and the order is the order they run.

Controlling step behavior

  • Conditions: skip a step unless a condition holds.
  • Continue-on-error: let the job proceed even if the step fails.
  • Environment: set variables visible to that step.
  • Working directory: run the step in a specific folder.

Steps vs jobs

Steps run sequentially and share a machine; jobs can run in parallel on separate machines and are isolated from each other. Choose steps for ordered work that shares files, and jobs for independent work you want to run at the same time.

Steps and pipeline speed

Slow steps (dependency installs, large downloads) dominate many jobs. Caching those steps and starting on a warm machine cuts the cost. Managed runners (Latchkey) keep dependency and image caches warm so the early steps of every job finish faster.

Key takeaways

  • A step is one command or action, the smallest unit inside a job.
  • Steps run in order and share the same workspace and machine.
  • A failing step stops the job by default unless you allow it to continue.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →