For the complete documentation index, see llms.txt. This page is also available as Markdown.

Steps

Steps are the smallest executable units in a Harness 3.0 pipeline; run scripts, invoke actions, request approvals, manage background services, and more.

A Step is the smallest executable unit within a pipeline stage. Steps are the building blocks that perform actual work; running scripts, invoking actions, requesting approvals, or managing background services. Harness 3.0 provides multiple step types with a flexible, short-form YAML syntax.

Step types

Step Type
Key
Description

Run

run

Execute shell commands

Run-Test

run-test

Execute tests with intelligence and splitting

Action

action

Invoke actions and plugins

Clone

clone

Clone a repository

Approval

approval

Request human or automated approval

Background

background

Start long-running services

Barrier

barrier

Synchronize parallel stages

Group

group

Sequential substeps

Parallel

parallel

Concurrent substeps

Queue

queue

Queue management

Template

template

Reference a reusable template

Common step properties

All step types share these common properties in addition to their type-specific fields.

interface StepCommon {
  id: string                              // Step identifier
  name: string                            // Display name
  if: string                              // Conditional execution
  disabled: boolean                       // Disable step
  timeout: string                         // Max execution time
  needs: string | string[]                // Step dependencies
  strategy: Strategy                      // Matrix/looping
  status: StatusConfig                    // Status configuration
  on-failure: FailureStrategy             // Failure handling
  delegate: DelegateSelector              // Delegate selector
  env: Record<string, string>             // Environment variables (GHA compat)
}

Run step

The Run step executes shell commands. It supports multiple syntax variants from single-line shorthand to fully configured forms with containers, environment variables, and test reports.

Shortest syntax

Named step

Multi-line script

Array of commands

Each command runs independently. If one fails, subsequent commands are skipped.

With container

Run the step inside a specific container image. Supports both a short-form string and a long-form object with pull policy, credentials, and resource limits.

With environment variables

With shell selection

Supported values: sh, bash, powershell, pwsh, python.

With test reports

Run-test step

The Run-Test step extends the Run step with built-in test intelligence, test splitting, and test report collection. Harness analyzes test results, identifies flaky tests, and optimizes execution through intelligent parallelism.

Basic test step

Test Intelligence

Harness Test Intelligence selects only the tests relevant to code changes, significantly reducing execution time.

Test splitting

Distribute tests across parallel instances for faster execution.

Action step

Action steps invoke pre-built integrations and plugins. Harness 3.0 supports GitHub Actions (via uses:), Harness plugins, and Drone plugins.

GitHub Action

Action with inputs

Harness plugin

GITHUB ACTIONS COMPATIBILITY

Harness 3.0 supports most GitHub Actions out of the box. Actions execute inside containers with the appropriate runtime. Some Actions that depend on GitHub-specific APIs may require configuration adjustments.

Approval step

Approval steps pause pipeline execution and wait for human or automated approval. Harness 3.0 supports native Harness approvals, Jira-based approvals, and ServiceNow-based approvals via the uses: field.

Harness Approval

Jira Approval

ServiceNow Approval

Background step

Background steps start long-running services that remain active for the duration of the stage. They share the same structure as Run steps but use the background: key. Typical uses include databases, caches, and local dev servers needed for integration testing.

Redis service

PostgreSQL service

Local dev server

Barrier step

Barrier steps synchronize execution across parallel stages. When a barrier is reached, the stage pauses until all other stages referencing the same barrier name also reach it. Barrier names must be declared in the pipeline.barriers list.

Synchronizing parallel stages

BARRIER SCOPE

Barriers are scoped to the current pipeline execution. All parallel stages referencing the same barrier name will wait for each other. If a stage fails before reaching the barrier, the barrier times out after the specified duration.

Clone step

The Clone step checks out source code from a repository. By default, Harness automatically clones the pipeline repository, but the Clone step allows full customization of depth, submodules, sparse checkout, and more.

Property
Type
Description

repo

string

Repository name to clone

depth

number

Clone depth (0 for full history)

submodules

boolean

Initialize and clone submodules

lfs

boolean

Fetch Git LFS files

sparse-checkout

string

Sparse checkout patterns

strategy

string

source-branch or merge

ref

string | object

Branch, tag, SHA, or structured ref object

Shallow clone

With submodules

Clone a specific repository

PR clone ref

Sparse checkout

Clone only specific directories from a large monorepo.

DEFAULT CLONE BEHAVIOR

If no Clone step is defined and clone: disabled is not set at the stage or pipeline level, Harness automatically clones the pipeline repository with default settings.

Group & parallel steps

Steps can be organized into sequential groups or run in parallel within a stage. Both group: and parallel: accept nested step lists and support conditionals, failure strategies, and other common step properties.

Sequential group

Parallel steps

All parallel steps must complete before the next step begins.

Group with failure strategy

Template step

Template steps reference reusable step templates stored in the Harness template library. The uses: field follows the pattern account.name@version.

Basic template reference

Template with version pinning

Template with inputs and env

Last updated

Was this helpful?