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
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
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
READINESS PROBES
Background services may take time to initialize. Use readiness probes or add an explicit wait step to ensure services are fully available before subsequent steps begin. Without verification, dependent steps may encounter connection failures.
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
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.
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.
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
PARALLEL STEP ISOLATION
Parallel steps share the same filesystem within a stage but execute concurrently. Be careful with steps that write to the same files. If isolation is needed, consider using parallel stages instead.
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
TEMPLATE VERSIONING
Always pin template versions in production pipelines. Using latest or omitting the version may cause unexpected behavior when the template is updated. Use semantic versioning (e.g., account.my-template@2.1.0) for reproducible builds.
Last updated
Was this helpful?