> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/overview/overview-1/parallel.md).

# Parallel

A Parallel step group runs multiple steps simultaneously. Use it to cut wall-clock time by executing independent tasks at the same time.

A **Parallel** step group runs all its steps at the same time. Use it to speed up your pipeline when steps do not depend on each other, for example, running tests against multiple environments simultaneously.

## What you will learn

* How a Parallel step group runs multiple steps simultaneously to reduce wall-clock time
* How to apply timeout, on-failure, strategy, and conditional execution to the group as a unit
* How failure of one step in the group affects the rest

***

## YAML

```yaml
stages:
  - name: build
    id: build
    steps:
      - name: parallel-group
        id: parallel_group
        parallel:
          steps:
            - name: task-a
              id: task_a
              run:
                script: ./task-a.sh
            - name: task-b
              id: task_b
              run:
                script: ./task-b.sh
```

All steps inside `parallel.steps` start at the same time. The group completes when all steps finish. If any step fails, the group's on-failure rule applies.

***

## Advanced settings

The parallel group supports all step-level advanced settings. These apply to the group as a whole. The default timeout is `2h`.

### Timeout

Terminates the entire group if it exceeds the specified duration. When a group times out, it is marked as **Expired**.

```yaml
- name: parallel-group
  id: parallel_group
  timeout: 20m
  parallel:
    steps:
      - name: task-a
        id: task_a
        run:
          script: ./task-a.sh
      - name: task-b
        id: task_b
        run:
          script: ./task-b.sh
```

### On failure

Controls what happens when any step inside the group fails:

```yaml
- name: parallel-group
  id: parallel_group
  on-failure:
    - errors:
        - all
      action: ignore
  parallel:
    steps:
      - name: task-a
        id: task_a
        run:
          script: ./task-a.sh
      - name: task-b
        id: task_b
        run:
          script: ./task-b.sh
```

### Strategy

Loops the entire group using a matrix, for, or while strategy. Each iteration runs all steps in parallel:

```yaml
- name: parallel-group
  id: parallel_group
  strategy:
    matrix:
      env:
        - staging
        - production
  parallel:
    steps:
      - name: smoke-test
        id: smoke_test
        run:
          script: ./smoke.sh ${{ matrix.env }}
      - name: api-test
        id: api_test
        run:
          script: ./api-test.sh ${{ matrix.env }}
```

### Conditional execution

Skips the entire group based on a JEXL condition:

```yaml
- name: parallel-group
  id: parallel_group
  if: <+OnPipelineSuccess>
  parallel:
    steps:
      - name: notify-slack
        id: notify_slack
        run:
          script: ./notify-slack.sh
      - name: notify-email
        id: notify_email
        run:
          script: ./notify-email.sh
```

***

## Next steps

* Go to [Steps overview](/harness-platform/3.0/harness-platform-resources/overview/overview-1.md) to review step types and common advanced settings.
* Go to [Group](/harness-platform/3.0/harness-platform-resources/overview/overview-1/group.md) to run steps sequentially inside a named container.
* Go to [On failure](/harness-platform/3.0/harness-platform-resources/overview/strategy/on-failure.md) to configure failure handling.
* Go to [Strategy](/harness-platform/3.0/harness-platform-resources/overview/strategy.md) to loop a group across values.
