For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Pipeline YAML reference

Complete YAML reference for Harness v1 pipelines: every key, its type, and a minimal example.

This page is a flat reference for all YAML keys supported in Harness v1 pipelines. Keys are grouped by scope: pipeline root, stage, step, and execution controls. Each section shows the key, its type, whether it is required, and a verified example.

What you will learn

  • The complete YAML structure for the pipeline root, stages, and steps

  • How to configure clone, inputs, notifications, and execution controls in YAML

  • The keys for strategies, failure handling, conditional execution, and timeout

  • YAML syntax for run steps, group steps, and parallel step groups


Pipeline root

The root key is always pipeline:.

pipeline:
  id: my_pipeline
  name: My Pipeline
  description: Optional description
  clone:
    enabled: false
  inputs:
    env:
      type: string
      default: production
      desc: Target environment
      required: false
  delegate: my-delegate
  timeout: 2h
  allow-stage-executions: true
  fixed-inputs-on-rerun: false
  notifications:
    - on:
        - pipeline:
            - failed
      uses: slack
      with:
        url: https://hooks.slack.com/services/your-webhook
  stages: []
Key
Type
Required
Description

id

string

Yes

Unique identifier for the pipeline. Used in expressions.

name

string

Yes

Display name shown in the UI.

description

string

No

Free-text description.

clone

object

No

Controls source repository cloning. Review Clone.

inputs

map

No

Typed runtime parameters. Review Inputs.

delegate

string or list

No

Delegate name or tag list for routing execution.

timeout

duration

No

Maximum pipeline run time. Default: 24h.

allow-stage-executions

boolean

No

When true, allows selective stage execution at runtime.

fixed-inputs-on-rerun

boolean

No

When true, locks inputs to original values on rerun.

notifications

list

No

Notification rules for pipeline events. Review Notifications.

stages

list

Yes

The ordered list of stages.


Clone

Controls whether and how Harness clones a source repository before running steps. The repo is cloned into /harness inside the runner.

To skip cloning entirely (common for pipelines that do not need source code):

Key
Type
Default
Description

enabled

boolean

true

Set to false to skip cloning.

repo

string

none

Harness Code repository name to clone.

depth

integer

full

Commit depth. 1 for a shallow clone (faster); omit for full history.


Inputs

Pipeline inputs are typed parameters collected at runtime.

Reference inputs in steps and conditions using ${{ inputs.<name> }} (CEL) or <+inputs.<name>> (JEXL in if conditions).

Field
Type
Description

type

string

string, number, boolean, secret, environment, or duration

default

value

Value used when none is provided at runtime.

desc

string

Label shown in the run form.

required

boolean

Whether a value must be supplied before running.

In if conditions (JEXL context), wrap input references in single quotes to avoid identifier errors: "'<+inputs.env>' == 'production'".


Notifications

Events

Event
YAML value

Pipeline starts

pipeline: start

Pipeline succeeds

pipeline: success

Pipeline fails

pipeline: failed

Pipeline ends (any)

pipeline: end

Stage starts

stage: start

Stage succeeds

stage: success

Stage fails

stage: failed

Step fails

step: failed

Trigger fails

trigger: failed

Channels

Channel

uses value

Required with fields

Email

email

recipients: [user@example.com]

Slack

slack

url: <webhook-url>

PagerDuty

pager-duty

key: <integration-key>

Microsoft Teams

ms-teams

url: <incoming-webhook-url>

Webhook

webhook

url: <webhook-url>


Stages

Each entry in pipeline.stages is a stage.

Key
Type
Required
Description

name

string

Yes

Display name.

id

string

Yes

Unique identifier within the pipeline. Used in expressions.

timeout

duration

No

Maximum stage run time. Default: 24h. Status on expiry: Expired.

on-failure

list

No

Failure rules. Review On failure.

if

string

No

JEXL condition. Stage is skipped when it evaluates to false. Review Conditional execution.

strategy

object

No

Looping strategy. Review Strategy.

steps

list

Yes (for plain stages)

The steps to run inside the stage.

group

n/a

n/a

Not valid at the stage level. Groups exist at the step level.

parallel

object

No

Parallel stage group. Review Parallel stage group.

chain

object

No

Chained pipeline. Review Chained pipeline.

Parallel stage group

Runs multiple child stages simultaneously.

Chained pipeline

Runs another pipeline as a stage.

Key
Type
Description

chain.uses

string

Child pipeline reference: org/project/pipeline_id.

chain.with.inputs

map

Input values to pass to the child pipeline.

chain.with.outputs

list

Output mappings to read from the child pipeline.


Steps

Each entry in stage.steps is a step. Steps run sequentially by default.

Key
Type
Required
Description

name

string

Yes

Display name.

id

string

Yes

Unique identifier within the stage.

timeout

duration

No

Maximum step run time. Default: 2h. Status on expiry: Expired.

on-failure

list

No

Failure rules. Review On failure.

if

string

No

JEXL condition. Step is skipped when it evaluates to false.

strategy

object

No

Looping strategy. Review Strategy.

run

object

No

Run step. Executes a shell script. Review Run step.

group

object

No

Group step. Runs child steps sequentially. Review Group step.

parallel

object

No

Parallel step group. Runs child steps simultaneously. Review Parallel step group.

deploy.uses: jiraApproval

object

No

Jira approval step. Pauses and polls a Jira issue. Review Jira approval step.

deploy.uses: serviceNowApproval

object

No

ServiceNow approval step. Pauses and polls a ServiceNow ticket. Review ServiceNow approval step.

Run step

Key
Type
Required
Description

run.script

string

Yes

Shell commands to execute. Multi-line supported with |.

run.shell

string

No

Shell to use: sh, bash, powershell, pwsh, python. Default: sh.

Group step

Runs child steps sequentially inside a named container.

Key
Type
Required
Description

group.steps

list

Yes

Steps to run sequentially inside the group.

The group key supports all step-level advanced settings: timeout, on-failure, strategy, if.

Parallel step group

Runs child steps simultaneously.

Key
Type
Required
Description

parallel.steps

list

Yes

Steps to run simultaneously.

The parallel key supports all step-level advanced settings: timeout, on-failure, strategy, if.

Jira approval step

Pauses the pipeline and polls a Jira issue until approval or reject criteria are met.

Key
Type
Required
Description

connector

string

Yes

Jira connector identifier. Use account., org., or no prefix for the matching scope.

issue

string

Yes

Jira issue key (for example, CDS-111000).

retry

duration

No

Polling interval. Default: 1m.

approve

object

No

Criteria that advance the pipeline.

approve.match-any-condition

boolean

No

true = OR logic (any condition); false or absent = AND logic.

approve.conditions

list

No

Field conditions. Each entry: field-name: { operator: value }.

reject

object

No

Criteria that fail the pipeline. Same structure as approve.

log_level

string

No

Log verbosity: info, warn, error. Default: info.

Supported operators: eq, not_eq, in, not_in.


ServiceNow approval step

Pauses the pipeline and polls a ServiceNow ticket until approval or reject criteria are met.

Key
Type
Required
Description

connector

string

Yes

ServiceNow connector identifier. Use account., org., or no prefix for the matching scope.

ticket_type

string

Yes

ServiceNow table or ticket type to poll.

ticket_number

string

Yes

Specific ticket number to poll.

retry

duration

No

Polling interval. Default: 1m.

approve

object

No

Criteria that advance the pipeline.

approve.match-any-condition

boolean

No

true = OR logic (any condition); false or absent = AND logic.

approve.conditions

list

No

Field conditions. Each entry: field-name: { operator: value }.

reject

object

No

Criteria that fail the pipeline. Same structure as approve.

change_window_start

string

No

ISO 8601 datetime or expression. Approval only accepted on or after this time.

change_window_end

string

No

ISO 8601 datetime or expression. Approval rejected after this time.

log_level

string

No

Log verbosity: info, warn, error. Default: info.

Supported operators: eq, not_eq, in, not_in.


Execution controls

Strategy

Applies to stages and steps. Runs the stage or step multiple times.

For loop: runs a fixed number of times in parallel.

Expression
Resolves to

${{ strategy.iteration }}

Current iteration index (0-based)

${{ strategy.iterations }}

Total number of iterations

While loop: runs sequentially up to a maximum number of iterations.

Matrix: fans out across all combinations of the defined axes.

Expression
Resolves to

${{ matrix.<axis> }}

Value of the axis for this instance

${{ strategy.iteration }}

Instance index (0-based)

Stage naming for matrix:

  • Single axis: <id>_0, <id>_1, …

  • Multiple axes: <id>_0_0, <id>_0_1, …

  • With node-name: <id>_<node-name-value> (hyphens converted to underscores)


On failure

Controls what Harness does when a stage or step fails. Always a list.

Error types

Value
Description

all

Matches any failure

timeout

Step or stage exceeded its timeout

authentication

Authentication failure

authorization

Authorization failure

connectivity

Network or connectivity failure

unknown

Unclassified error

verification

Verification step failure

approval-rejection

An approval step was rejected

delegate-provisioning

Delegate could not be provisioned

delegate-restart

Delegate restarted during execution

input-timeout

Manual intervention wait timed out

policy-evaluation

OPA policy evaluation failed

user-mark-fail

User manually marked the step as failed

Actions

Value
Description

fail

Mark as failed and stop the pipeline (default)

abort

Abort the entire pipeline

ignore

Continue execution; pipeline shows IgnoreFailed status

success

Treat the failure as success

retry

Retry with backoff. See below.

manual-intervention

Pause for user action. See below.

stage-rollback

Roll back the current stage

pipeline-rollback

Roll back the entire pipeline

Retry with backoff

Retry then manual intervention

timeout-action valid values: fail, ignore, abort, success, stage-rollback, pipeline-rollback.

When manual-intervention is triggered, Harness pauses execution and displays a popup with options: Mark as Success, Ignore, Retry, Abort, Rollback Stage.


Conditional execution

The if key takes a JEXL expression that is evaluated at runtime. The stage or step runs only when the expression evaluates to true.

Base conditions

Expression
When it runs

<+OnPipelineSuccess>

All prior stages succeeded

<+OnPipelineFailure>

One or more prior stages failed

<+Always>

Always runs regardless of prior stage status

Combined expressions

Input variable comparison (quotes required)


Timeout

Sets the maximum run time for a stage or step. Accepts duration strings.

Format
Example
Equivalent

Seconds

90s

1 min 30 sec

Minutes

30m

30 minutes

Hours

2h

2 hours

Days

1d

24 hours

Combined

1h 30m

1 hour 30 minutes

  • Stage default: 24h. Step default: 2h.

  • When a stage or step times out it is marked as Expired.

  • Handle timeouts specifically with errors: [timeout] in on-failure.


Concurrency

Limits how many instances of a strategy run simultaneously within a single execution. Applies at the stage level alongside a strategy.

max-parallel: 0 means unlimited (all instances start at once). max-parallel: 1 forces serial execution.


Duration format reference

All timeout and interval fields accept the following formats:

Format
Example

Seconds

30s

Minutes

15m

Hours

2h

Days

1d

Combined

1h 30m


Troubleshooting

  • An if condition referencing an input throws an identifier error: Wrap <+inputs.varName> in single quotes inside the expression, for example "'<+inputs.env>' == 'production'". Without the quotes, the resolved value is treated as a JEXL identifier instead of a string literal.

  • A stage or step is marked Expired instead of failing normally: This is expected when the stage or step exceeds its timeout. Handle timeouts specifically with errors: [timeout] in on-failure.

Next steps

  • Go to Pipeline settings to configure inputs, delegate, notifications, and more.

  • Go to Strategy to review looping strategy details and verified expressions.

  • Go to On failure to review the full failure handling reference.

  • Go to Conditional execution to review JEXL condition details.

  • Go to Timeout to review timeout behavior and status codes.

  • Go to Steps overview to review step types and advanced settings.

Last updated

Was this helpful?